静态HTML文件中引入js跨域报错Cross origin requests are only supported for......
静态HTML文件中引入js跨域报错Cross origin requests are only supported for......本文场景原因解决方法本文场景在使用vs code写html时,引入的js文件需要跨域引入module。原因使用了File协议,需要使用http, data, chrome-extension, edge, https等协议,通俗来讲就是需要用到服务器开个端口。解决方法直接在vs code中右击,选择Open with Live Server。...
原创
2021-01-16 20:02:31 ·
530 阅读 ·
0 评论