Error: “Origin null is not allowed by Access-Control-Allow-Origin” when loading an XML file with JQuery's ajax method

后端 未结 5 1735
我在风中等你
我在风中等你 2020-11-30 10:27

This is my code:

this.loadMap = function () {
    this._map = null;
    this._width = 0;
    this._height = 0;
    this._playerX = 0;
    this._playerY = 0;
         


        
5条回答
  •  清歌不尽
    2020-11-30 10:53

    You try to access both web page and resources file as file route file:///

    You can do following in OSX

    open /Applications/Google\ Chrome.app --args --allow-file-access-from-files
    

    try to request web page with local server (http://localhost/your_website.html)

    read more about cross site and iFrame at http://weblog.bocoup.com/third-party-javascript-development-future/

提交回复
热议问题