我写了一个在Chrome和Firefox中运行良好的bookmarklet,但它无法添加到文档中。我认为这与它在IE收藏夹栏中被列为“未评级”有关,但我不确定是哪部分代码触发了这一点:
<a href="javascript:(function() {
var elem=document.createElement('script');
elem.setAttribute('type','text/javascript');
elem.setAttribute('src', 'http://www.joshdforbes.com/web2mobile/
web2mobile.js?t='+(new Date().getTime()));
document.body.appendChild(elem);
})()">Web2Mobile</a>
在互联网上很难找到任何关于IE10中的差异是什么的信息,这将导致这种情况。任何帮助都将不胜感激。
谢谢!
发布于 2013-06-12 09:12:31
它对我很有效,但我用的是IE8。是你先压缩的吗?
javascript:(function(){var elem=document.createElement('script');elem.setAttribute('type','text/javascript');elem.setAttribute('src','http://www.joshdforbes.com/web2mobile/web2mobile.js?t='+(new Date().getTime()));document.body.appendChild(elem);})()
我最初确实收到了警告消息,但我忽略了它,它起作用了。
https://stackoverflow.com/questions/17056160
复制相似问题