FireFox 代码无法运行
Firefox 是否有任何原因不显示下面的代码? 它可以在所有其他浏览器中工作,并创建注释
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = 'http://sample.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
ps 如果与 Firefox 相关的代码没有任何明显的错误,那么它一定是其他浏览器,我会继续挖掘。我在想也许他们不认识其中一个标签之类的?但我想他们会的。
is there any reason why firefox might not display this code below?
It works in every other browser and creates the comments
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = 'http://sample.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
p.s. if there isn't anything obviously wrong with the code with respect to firefox it must be something else and I'll keep digging. I was thinking maybe they don't recognize one of the tags or something? But I guess they do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
用这种方式。
因为它与所有浏览器兼容。
use this way.
because its compatible with all browser.
这是一个示例: http://www.phpied.com/javascript-include-ready -onload/ 使用
setAttribute
而不是点表示法属性。也许这就是 Firefox 想要的? (没试过这个)Here is an example: http://www.phpied.com/javascript-include-ready-onload/ that uses
setAttribute
instead of dot notation properties. Maybe that is what Firefox wants? (haven't tried this)