Kir*_*rby 6 javascript mobile addthis angularjs ionic-framework
我正在使用Ionic v1并在Chrome(离子服务)和View App(离子上传)中进行测试.
我在index.html中包含了这个脚本
<script src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=foo&async=1"></script>
Run Code Online (Sandbox Code Playgroud)
并添加了https://github.com/thisissoon/angular-addthis指令.
<sn-addthis-toolbox class="addthis_custom_sharing"
data-share="{
title: thing.title,
url: 'https://myurl/' + thing.id,
description: 'Check out my thing.'
}">
<a href class="addthis_button_email"></a>
<a href class="addthis_button_facebook"></a>
<a href class="addthis_button_twitter"></a>
<a href class="addthis_button_google_plusone_share"></a>
</sn-addthis-toolbox>
Run Code Online (Sandbox Code Playgroud)
在Chrome或firefox中查看我的离子应用程序时,一切看起来都很棒.当我按下Ionic视图时,我的addthis按钮丢失了.在Chrome开发者工具中,任何响应式视图或设备都可以看起来很棒.
任何方向在这里都会有所帮助.我如何在Ionic视图中看到错误消息?
为什么addthis.com js小部件无法在移动设备上运行?
TIA.
编辑:我添加了https,这使事情更进一步.(感谢adamdport)
现在看到无法加载文件://m.addthisedge.com/live/boost/foo/_ate.track.config_resp资源:NET ERR_FILE_NOT_FOUND
和
未捕获的TypeError:无法在r(https://s7.addthis.com/js/300/addthis_widget.js:2:44431)的e.exports上读取null的属性'split' (https://s7.addthis.com /js/300/addthis_widget.js:2:211271)访问https://s7.addthis.com/js/300/addthis_widget.js:2:224158 ,网址为https://s7.addthis.com/js/300/ addthis_widget.js:2:361724 at o(https://s7.addthis.com/js/300/addthis_widget.js:2:223353)https://s7.addthis.com/js/300/addthis_widget.js : HTMLDocument.onReady上的2:215504(https://s7.addthis.com/js/300/addthis_widget.js:2:214257)
在addthis_widget.js第2行
最终编辑和解决方案:我学会解决此问题的最佳方法是通过USB连接我的Nexus 6p,启用USB调试,以及https://developers.google.com/web/tools/chrome-devtools/remote-debugging /
我解决了您关于为什么您的脚本未加载的原始问题:它涉及您对和的使用//和切换。如果您的 Ionic URL 使用,您的脚本 src 中的 也会尝试使用 检索您的脚本,并且可能无法加载。httphttpshttps:////https
既然您已经编辑,我已经指出它file://仅适用于您的本地文件系统。如果您尝试从服务器引用它,它仍然会尝试从客户端计算机加载资源。
如果您需要进一步的帮助,我建议您发布另一个问题。
| 归档时间: |
|
| 查看次数: |
624 次 |
| 最近记录: |