Total members 11889 |It is currently Fri Mar 29, 2024 3:48 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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.



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  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     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com