开发者

Direct file access vs. from localhost

Jquery ajax and direct ajax implementation done on my p开发者_开发问答age. when I try to call ajax request from server it works fine when I direct double click on file, but when same file calls from localhost it gives me 302 error code.

I m not understanding why it gives me an error also same file not works in windows machines too but very well works on mac's & iphone simulator safari.

I have implemented soap request, just for your information.

So please let me know, it is problem with client or server side? how to resolve that problem?


If you are using chrome, $.ajax will not work when testing from Localhost. The error you will get is

Origin null is not allowed by Access-Control-Allow-Origin

In Firefox and IE you can.

There are allot of posts on Stackoverflow discussing this issue. Here's one Debugging Access-Control-Allow-Origin with Chrome/WebKit

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜