1 $('#dictionary').load('a.html'); 方法 ok
2 $.getJSON('b.json',function(data){ 方法 ok
3 但是 $.getScript("c.js"); 就不行了,表现为浏览器没反应。
在vscode里面调试,使用配置chrome,在 c.js中加入断点,但无法进入,报错
Access to XMLHttpRequest at 'file:///F:/%E7%BD%91%E8%AF%BE/jQuery%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/Learning%20jQuery%20-%20Fourth%20Edition/Code/Chapter%206/b.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
jquery.js:8475
Access to XMLHttpRequest at 'file:///F:/%E7%BD%91%E8%AF%BE/jQuery%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/Learning%20jQuery%20-%20Fourth%20Edition/Code/Chapter%206/c.js?_=1584516787763' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https