 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
shivendrawhizkid Smarty n00b
Joined: 22 Jun 2012 Posts: 2
|
Posted: Fri Jun 22, 2012 11:37 pm Post subject: Infinite scroll using smarty n AJAX |
|
|
HI , so I have managed to implement infinite scroll , without smarty . And pagination with SMARTY.
But I am unable to implement an infinite scroll with smarty and data fetched through AJAX ( because fetching all data and showing on scroll down would be very inefficient).
The point is , using AJAX ,where I provide with an HTML document's URL ( whose data the infinite scroll fetches) . But when I have to fetch data from a DB and show it on a template , I am utterly confused.
Please Any help/suggestions regarding this is most welcome . Thanks. |
|
| Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7042 Location: Lincoln Nebraska, USA
|
Posted: Sat Jun 23, 2012 2:11 pm Post subject: |
|
|
| I would think infinite scroll and pagination would be mutual exclusive, ie. they are both ways to move through content. Either one could be fetching data from a DB. So I guess I don't know the question. You want to know how to use infinite scrolling (via AJAX) to fetch data from a DB? That would depend on your code both server-side and client-side. |
|
| Back to top |
|
shivendrawhizkid Smarty n00b
Joined: 22 Jun 2012 Posts: 2
|
Posted: Sat Jun 23, 2012 5:06 pm Post subject: Infinite scroll using smarty n AJAX |
|
|
| mohrt wrote: | | I would think infinite scroll and pagination would be mutual exclusive, ie. they are both ways to move through content. Either one could be fetching data from a DB. So I guess I don't know the question. You want to know how to use infinite scrolling (via AJAX) to fetch data from a DB? That would depend on your code both server-side and client-side. |
Ya precisely.. may be the problem statement was a little vague.. i want to implement infinitescroll using AJAX n Smarty.. fr fetching data from DB .. , so any help would be appreciated. |
|
| Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7042 Location: Lincoln Nebraska, USA
|
Posted: Sat Jun 23, 2012 9:09 pm Post subject: |
|
|
| Take any PHP/JS scrolling code that works without Smarty, and simply move the HTML/CSS/JS into a Smarty template. It's that simple. Smarty is agnostic to exactly what is being fed to the browser, it is just text as far as Smarty cares. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|