This is the code below,
The Page loads fine with the dayofweek and hourofday functions. But shortly after the browser (chrome) freezes up and gives the error : net::ERR_INSUFFICIENT_RESOURCES and referrs to the Jquery library and my hourofday.js script.
After a few mins it starts getting errors like crazy and it freezes. I cant even reload the page. And the resoure
here is the script:
function dayofweek(){
$.ajax({
url: "dayofweek.php",
type: "POST",
dataType: "xml",
success: function (xml){
var day = $(xml).find('day').first().text();
$("#dayofweek").html(day);
},
error: function (xhr, status) {
},
complete: function (xhr, status) {
}
});
}
function hourofday(){
$.ajax({
url: "hourofday.php",
type: "POST",
dataType: "xml",
success: function (xml){
var response = $(xml).find('response').first().text();
$("#hourofday").html(response);
},
error: function (xhr, status) {
},
complete: function (xhr, status) {
}
});
setInterval(dayofweek, 6000);
setInterval(hourofday, 6000);
}
No comments:
Post a Comment