blocked a frame of origin “null” from accessing a cross-origin frame - chrome

后端 未结 2 1585
我在风中等你
我在风中等你 2020-11-30 12:02

I\'m new to Javascript and am learning the basics via a textbook that focuses on its applications in IE 7+ and Firefox 2+. However, I am using Chrome and am getting the foll

相关标签:
2条回答
  • 2020-11-30 12:39

    If you don't want to use a local web server as suggested in the accepted answer you can run the browser with cross domain web security / same origin policy disabled.

    For Chrome:

    Disable same origin policy in Chrome

    For Firefox:

    Disable cross domain web security in Firefox

    https://addons.mozilla.org/en-US/firefox/addon/access-control-allow-origin/

    Disable firefox same origin policy

    0 讨论(0)
  • 2020-11-30 13:03

    This happens because Chrome doesn't allow frames from your hard disk to access each others' content. Which, technically we term as Cross-origin request.

    Solution of the above problem is:

    1. Either you host your webpage on a local web server. See the following link:
    What is a faster alternative to Python's http.server (or SimpleHTTPServer)?

    2. Use any other browser like Firefox

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