Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.7k views
in Technique[技术] by (71.8m points)

在线引用JS代码改为本地引用,无法生效

引用了国外某网站的JS代码,因为国内有时无法访问,于是把JS代码下载到本地,另存为polyfill.min.js,使用本地引用,但是不能生效,不知问题出在哪里

下面代码引用正常

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,Array.prototype.includes,CustomEvent,Object.entries,Object.values,URL"></script>

下面代码引用失效

<script src="./polyfill.min.js?features=es6,Array.prototype.includes,CustomEvent,Object.entries,Object.values,URL"></script>

下面的链接是问题的具体操作演示:
https://www39.zippyshare.com/...

相关文件的下载链接:
下面是相关文件的链接:https://www96.zippyshare.com/...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Polyfill 只是用来为旧浏览器提供它没有原生支持的较新的功能。
这个js就为了支持es6 的 一些方法

你怎么判断它是的失效了, 有报错吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...