Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle "infinite" web pages?

Once upon a time, life was simple: All web pages had finite length and if they didn't fit into the current windows/view size, you'd simply scroll down until you reached the bottom of the page.

But I recently noticed that there is a new trend in the web design world: Bottomless web pages.

Probably the most familiar examples of sites utilizing such pages are Facebook and Twitter: You scroll to the "bottom", only to trigger some refresh that adds content to the page, so the "old bottom" is no longer a bottom and, instead, there is a new "bottom".

In an Android WebView, I need to be able capture all the content currently available on that "page", but I am not sure how to approach this:

Simulate user's scroll down via View.scrollBy(int x, int y), pageDown() or window.scrollTo()?

Or is there an API method that does this automatically for me?

Or am I approaching this completely wrong and I shouldn't attempt to get to the "real bottom" in one capture (if possible at all)?

EDIT: It seems that tagging this question javascript communicated the opposite message. I am interested in capturing (then processing) such bottomless pages on Android's WebView, using Java.

like image 634
ef2011 Avatar asked May 26 '11 21:05

ef2011


People also ask

Is infinite scroll SEO friendly?

Introducing an infinite scroll should depend on your goal to achieve with a particular page. This is an SEO-friendly solution that needs to be properly implemented.

Does Google crawl infinite scroll?

The short answer is: Yes, Googlebot can crawl and index webpages that utilize infinite scrolling.

What is infinite scrolling?

Infinite scrolling is a web-design technique that loads content continuously as the user scrolls down the page, eliminating the need for pagination. The success of infinite scrolling on social media sites such as Twitter have made this technique popular, but that doesn't mean you should do it too.


3 Answers

Edit: disregard this answer, I misunderstood the question. Leaving the answer in case others misunderstand the question as well.


You could use the jqPageFlow jQuery plugin, or base yourself on its documentation.

Infinite scroll is another great option.

like image 146
Olivier L. Avatar answered Oct 02 '22 19:10

Olivier L.


This jQuery plugin does just that: http://www.webresourcesdepot.com/load-content-while-scrolling-with-jquery/

Another, with jQuery an PHP: http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html

like image 24
Graeck Avatar answered Oct 02 '22 21:10

Graeck


Regardless what language do you use, the solution is quite simple. You just catch the bechavior of user (by capturing current y and comparing it to max y od the page), then You have to add some new information to you content, by async connection. That is all. Don't know very well Java so I can only give a hint, but the idea is the same in all technologies/languages.

like image 40
pawel-kuznik Avatar answered Oct 02 '22 20:10

pawel-kuznik