开发者

jquery ajax URL without extension

I am trying to do ajax call with jquery. But URL is an URL without extension. i.e. http://xyz.com/atom/home

If I save it locally. with home.xml it works perfectly. But if it is without extension. It doesn't work.

Is there a reason why? Or is there a way to fix it? I do not have control to the URL that I am calling.

$.ajax({
  url: 'home', //doesn't work, but if it home.xml or home.rss it works.
  dataType: 'xml',
  success: function(data) {
    $(data).find('entry').each(functio开发者_如何学JAVAn() {
        //do something
    });
  }
});


I would recommend you to install FireBug for firefox or any other debugging console for your favorite browser. It will show all your AJAX requests and their's response. I will guess that server is configured to not to return files without extensions. But without the response header it's hard to say.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜