I have this weird issue that jquery.load sometimes fails on chrome. I’m not gonna bother you guys with the details, I’m just looking for a pointing hand on how can i debug such an issue?
I thought of maybe the firebug could help, but the issue happens only on chrome (even works on IE).
I do something like:
$("#contentid").html("Plz wait.");
$("#contentid").load(url);
$("#contentid").show();
I get only the “Plz wait” on #contentid, and i can see the url getting called, and check it manually and see it succeeds.
UPDATE2:
so i changed the load calls according to suggestions
$('#conentid').load(url, function(response, status, xhr){
alert('Load was performed. url:' + url);
if (status == "error")
{
alert("text: " + xhr.statusText);
alert("readyState: "+xhr.readyState+"\nstatus: " + xhr.status);
alert("responseText: "+xhr.responseText);
}
else
{
$("#conentid").show();
}
});
I get status==’error’ when the errors occur.
xhr.statusText: 0
xhr.readyState: 4
xhr.statusText and xhr.responseText are empty
any idea why? what does this mean?
The url works manually. and this error happens only on chrome, and only sometimes
Maybe someone else could have an explanation for this answer, but the problem was:
I had a base href TAG (
<base href="http://domain.com/" />)There are some references for problems with using jquery + base href out there.
I have no idea why, but removing this line fixed everything. thanks for all your help, I learned some web debugging\ajax tips in the process.