Switch to full style
HTML,DHTML,Javascript,XML,CSS
Post a reply

Solution to Error status zero when using Ajax with JQuery

Tue Jan 01, 2013 3:23 pm

Fix to return error zero for and AJax and JQuery ,

I have tried to run my following code simply on my PC desktop , and i was getting error file not found (404)
javascript code
$(document).ready(function(){
   $("button#b1").click(function(){
  $("div#d1").load("smallTable.html",function(responseTxt,statusTxt,xhr){
    if(statusTxt=="success")
      alert("File Loaded successfully!");
    if(statusTxt=="error")
      alert("Error: "+xhr.status+": "+xhr.statusText);
  });
 });
  
});
 


I moved the file smallTable.html to :
javascript code
$("div#d1").load("http://www.codemiles.com/smallTable.html",function(responseTxt,statusTxt,xhr){


I started to get error zero , i found that there is a security policy restrict the Ajax calls to be on the same server path. so i moved the original file and smallTable to same server and it works fine.



Post a reply
  Related Posts  to : Solution to Error status zero when using Ajax with JQuery
 Solution to AJax Cache problem with Internet Explorer     -  
 Error handling in AJAX     -  
 AJAX SYNTAX ERROR IE     -  
 Load Content to Tabs using AJAX and JQuery     -  
 Load file and update content using AJAX and JQuery     -  
 status Progress bar     -  
 Print all MySQL status value     -  
 Status Bar Link Description javascript code     -  
 Typing Status Bar Text javascript code     -  
 show loading status message until the applet is fully loaded     -