开发者

Allow XMLHttpRequest Execution From Local File

I'm writing a JavaScript client application that uses the XMLHttpRequest object to fetch XML data from a server. However, all browsers except IE7/8 deny the request due to security concerns as outlined in the Same Origin Policy. It's important that this application works in IE, FF, and Chrome when run as a local file.

I've found success in Chrome when I use the --disable-web-security flag, but I can't imagine clients laughing it off when I say "Oh, make sure you disable web security or else it won't work."

I'd reall开发者_如何转开发y appreciate some help!

EDIT: I don't have access to the server the XML comes from.


You may build a kind of proxy, a serverside application somewhere on the web, which retrieves the XML and delivers the xml inside a javascript-file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜