开发者

getting 404 error using jQuery.Ajax in Google App Engine

开发者 https://www.devze.com 2023-03-02 12:50 出处:网络
In my google apps engine application, I\'m trying to get data from an XML file using jquery.Ajax but when I run the page, it returns a 404 error for the XML file. The XML file is in the root folder of

In my google apps engine application, I'm trying to get data from an XML file using jquery.Ajax but when I run the page, it returns a 404 error for the XML file. The XML file is in the root folder of the application i.e. on the same level as the index page.

I have an index page and in the index page, I have the code below (within a script tag)

$(document).ready(function(){
  $.ajax({
    type: "GET",
    url: "states.xml",
    dataType: "xml",
    error:function(xhr,err){
       alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
       alert("responseText: "+xhr.respon开发者_StackOverflow中文版seText);
    },              
    success: function(xml) {
       alert("success");
    }
  });
 });  


Do you have a static file handler defined in your app.yaml? If all you've done is placed the XML file in the application root, it will not be automatically routable.

http://code.google.com/appengine/docs/python/config/appconfig.html#Static_File_Handlers

0

精彩评论

暂无评论...
验证码 换一张
取 消