I am using jQuery to load in the 10 newest posts when a function is executed like this:
function loadContent() {
jQuery("#conz").load("http://mydomain.com/wallload.php?id=1&p=1", function(){
jQuery("#conz").slideDown(200);
});
}
But I want to update the page number when the function is executed. The page number is the “&p=1” in the url of the .load source page. So first of all, I want to insert a variable or string into the url which is set to 1 on page load, but plussed up one every time the function is executed.
So basically, when they click the link to execute the function, it will load the first page. Then the next time they do, it will load the next page, see my point?
I guess this is pretty easy for those of you who know Javascript, but I do not at all, so please help 🙂
keep a variable outside your function and increment it every time you call the function.