Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Lumpy posted:

Fetch all the IDs in random order, store them as a javascript array. Take the first 20 elements, get the content for them via AJAX, there's your first page. They hit NEXT, get content for IDs 21-40 in your array, etc.

My only question with this approach is how do you handle the insertion of new content? Is the user supposed to refresh the page to see the new content or should the new content's ID be appended to the end of the array when the user clicks next?

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Lumpy posted:

If things are being inserted so fast it's relevant, your 'get content for IDs' ajax call could also pass along new Ids, but from the way he described the problem, it doesn't seem like it's a big deal. If you don't see Billy Bob's Sports Bar until the next time you refresh the page and click on X in the pagination UI to see it, meh.

The question was in general, not his specific problem. I have to solve this issue of pagination soon and was wondering what the best approach would be.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Remember that date validation is Locale specific, but there are a lot of good jquery date validator plugins.

  • Locked thread