Hi,
http://imgur.com/gallery when you scroll to the bottom more content is displayed without the page reloading. How is this done?? My only guess is ajax?? Can someone point me to the right direction thanks.
Hi,
http://imgur.com/gallery when you scroll to the bottom more content is displayed without the page reloading. How is this done?? My only guess is ajax?? Can someone point me to the right direction thanks.
It is ajax which probably uses php as well.
This thread relates to this somewhat http://www.dynamicdrive.com/forums/s...ad.php?t=64281
Corrections to my coding/thoughts welcome.
AJAX is a method in Javascript to dynamically load a page on the server. Although that page can be just plain HTML, it is most often a serverside language (such as PHP, ASP, CGI, JSP, etc.) so that new dynamic content from the server (such as a database) can be loaded.
In other words, it's not usually "PHP or Ajax". Ajax is the method for loading something (often PHP) in the browser.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
One could use AJAX for that. Or, since it's images, something like:
http://www.appelsiini.net/projects/lazyload
could be used.
Oddly enough, AJAX would probably be easier to make be the way it's done on that page you linked to. And from my experience in the past working with Lazy Load, probably more cross browser.
You could include some PHP, to like grab the images from a folder. But if you already know the images, no PHP would be required.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Right: the reason that PHP (or another serverside language) is [probably] required for this is that Javascript won't know the paths to all of the images. That would require preloading all of that information into JS when the page originally loads, still using PHP to do it, and it would load a limited amount inefficiently: if it's too few, then you wouldn't be able to continue loading pages, but if it's too many, then that's a waste of processing and bandwidth every time the page is loaded.
The cleanest way to do this, in my opinion, would be to use Javascript to generate a standard layout and add it to the page's current HTML source. It would also use Ajax to request a list of new images (along with descriptions and whatever else is required). You would use an array of some sort, potentially XML, probably best as JSON. Then those would be inserted into that standard layout. There's no point in transferring the HTML layout every time since it never changes.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks