/ Published in: jQuery

Very rudimentary script for loading all posts on a tumblr blog at the same time. Needs a lot of work, just a concept really.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Presumes your posts code is inside a div "#posts" and ".page" inside this. $(document).ready(function() { var totalPages = $("#hidden_navinfo .totalpages").text(); for ( var i = 1, len = totalPages; i < len; i++) { var count = i+1; var new_posts = ""; $.get("/page/" + count, function(data) { $("#posts").append($('.page', $(data))); }); } }); // This needs to go in the the page div <div id="hidden_navinfo"><span class="totalpages">{TotalPages}</span></div>
Comments
