XMLHttpRequest cannot load URL. Origin not allowed by Access-Control-Allow-Origin

后端 未结 1 873
心在旅途
心在旅途 2021-01-05 08:44

I want to make a small website that uses xml data from another domain. (Weather data from Weather Underground: www.wunderground.com). I am using just html and javascript, an

相关标签:
1条回答
  • 2021-01-05 09:24

    Use Ajax with JSONP if you want in jquery

    For javascript see here , http://developer.chrome.com/extensions/xhr.html and http://www.leggetter.co.uk/2010/03/12/making-cross-domain-javascript-requests-using-xmlhttprequest-or-xdomainrequest.html

    Use .json format data rather than .xml to make your application simpler and faster i.e http://api.wunderground.com/api/3c6e3d838e217361/geolookup/conditions/forecast/q/51.11999893,-114.01999664.json

    0 讨论(0)
提交回复
热议问题