ie6/7 script tag population giving "unexpected call to method or property access"

I use AJAX to get the content of a script, and then use the following code: var scr = document.createElement('script'); scr.appendChild(document.createTextNode(script)); // *** document.getElementsByTagName('head')[0].appendChild(scr); Where `script` is astring populated from AJAX. This works fine in IE9, Chrome and Firefox. However, in IE6 and 7 I get an error: > Unexpected call to method or property access IE gives the number of the the line indicated with the `// ***`. Although there are multiple other questions about this, none of the appear to address this precise issue.

以上就是ie6/7 script tag population giving "unexpected call to method or property access"的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏