Sorry, that I have been posting here so often — I have been doing a lot of work and in turn have ran into lots of problems.
The click handler just modifies some global variables and sends those variables off to update the page via Ajax. Here is my Javascript: (please note that the getPosts function is working, but it is not being called on .click() presumably).
if you wish to view the documents in the flesh, go to http://www.ethoma.com/testhome.php and for the php go to http://www.ethoma.com/getposts.php.
var category = "undefined";
var page = 0;
var order="id";
function getPosts(){
var queryString = "category=" + category + "&page=" + page + "&order=" + order;
$.ajax({
url: 'getposts.php',
data: queryString,
success: function(data) {
$('#postcontainer').html(data);
}
});
}
$(document).ready(function() {
getPosts();
});
setTimeout(getPosts(), 20000);
$("#all").click(function(){
category = "etc.";
getPosts();
});
Your click is assigned outside the document.ready
I would do
Firefox console even tells you one of the errors, except in a very w3schools way 😉