I have read many posts(problems) with IE and jquery posts, but never thought I'd be asking how to make it work in Firefox, as it works great in IE9(with headers for no cache) and Chrome.
$(document).ready(function(){
setInterval(function(){
$.post("dashBoardsql.php", {track : 2}, function(pendingReq){
$("#myTable").html(pendingReq);
}),
"html" });
}, 27000);
Is my jquery code, like I said, it works fine in IE9 and Chrome, but I have to refresh the page in FF12 to see an update passed back by pendingReq. I've used Firebug to watch the console with the POST data, and it just sits until I F5 the page. Also, no errors are reported and my header for no-cache, must revalidate is in place:
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Any suggestions? Also of note, testing is being done with WAMP on my local machine, so no cross-domain issues
SOLVED! The issue 'was' a syntax error, but not in the way suggested, @KevinB example on fiddle showed me, from the original code above, it now looks like:
$(document).ready(function(){
setInterval(function(){
$.post("dashBoardsql.php?_=" + $.now(), {track : 2}, function(pendingReq){
$("#myTable").html(pendingReq);
}),
"html"
}, 27000);
});
Plus all the header info, but I see all the new timestamps appear and updates happen. Thank you all!