Make a Cross-Domain request for XML from a local file

泪湿孤枕 提交于 2019-12-02 03:03:22

Well, if you are having a problem with the cross domain policy, you might need to build some sort of proxy that will do the request for you. (Its pretty simple to make)

If you want to open a JavaScript file to make an Ajax request I'd use Dojo to parse the XML.

You have a nice example here: http://dojotoolkit.org/reference-guide/dojo/xhrGet.html

Hope it helps.

Regardless of payload type JSON or XML what you are doing is JSONP and the result is a javascript function call. So the response must be a valid javascript function call with XML data as input to that function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!