简体   繁体   English

单独的Addthis js文件

[英]Separate Addthis js file

I would like to add a separate AddThis JS file 我想添加一个单独的AddThis JS文件

Currently it using its own CDN link: 目前,它使用自己的CDN链接:

<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=xxx"></script>

I tried to copy all the code and make my own addthis.js file but it didn't work. 我试图复制所有代码并创建自己的addthis.js文件,但是它不起作用。

I also tried the following: 我还尝试了以下方法:

<script type="text/javascript" src="addthis.js#pubid=xxx"></script>

But I didn't work. 但是我没工作。

Can someone tell me how do fix it? 有人可以告诉我该如何解决吗?

Thanks. 谢谢。

Unfortunately, the addthis_widet.js code isn't meant to be hosted by websites. 不幸的是,addthis_widet.js代码并不意味着由网站托管。 We reference other JS files which are hosted on our CDN, but since they are relative to the addthis_widget.js file, we won't be able to load them. 我们引用了CDN上托管的其他JS文件,但是由于它们是相对于addthis_widget.js文件的,因此我们将无法加载它们。 Also, we update the addthis_widget.js to reference updated files with fixes and new features, so if you try to host it yourself, you won't get updates. 此外,我们更新addthis_widget.js以引用具有修复程序和新功能的更新文件,因此,如果您尝试自己托管它,则不会获得更新。 Is there a reason why you want host the file yourself? 您为什么要自己托管文件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM