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前端其它相关文章!