IE中的脚本加载 [英] Script onload in IE

查看:147
本文介绍了IE中的脚本加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有脚本,该脚本会附加在文档中:

I have script, which appends in the document:

window.d = document     

s = d.createElement('script') 
s.setAttribute('type','text/javascript')
s.setAttribute('src',options.url)
d.getElementById(block_id).appendChild(s)

$(s).load(function() { 
    alert('')
})

在Opera中,FF和Chrome load可以正常工作,但在IE中则不能.

In Opera, FF and Chrome load works fine, but not in IE.

推荐答案

这个类似问题的答案可能会对您有所帮助

The answer to this similar question may help you

IE中的Element.appendChild()阻塞了

原因可能是appendChild不能在IE中工作.

The reason may be that appendChild just doesn't work in IE.

这篇关于IE中的脚本加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆