[jQuery] ifModified - status is "notmodified", although response isn't empty
<span class="gmail_quote"></span>Hello,
I send an request to a php file on the server:
$(document).ready(function(){
updatePresenceBox();
setTimeout("updatePresenceBox()", 3000);
setTimeout("updatePresenceBox()", 6000);
});
function updatePresenceBox() {
$.ajax({
url: "test.php",
dataType: "html",
ifModified: "true",
complete: function(data, status){ alert(status); },
success: function(html) {alert("i'm successful"); $("#presence").html(html); }
});
}
The status is like I expected: First time "success", second and third time "notmodified". But in Firebug I see that the response contains always the generated text ("test with php") from the php file (when I test this case with a html file the response is empty).
Can someone please explain me why?
This is the code in my "test.php" file:
header("Last-modified: Thu, 01 Jan 2007 10:00:00 GMT");
echo "test with php";
exit;