Create dynamic script - IE doesn't work
        Posted  
        
            by poru
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by poru
        
        
        
        Published on 2010-05-13T17:40:42Z
        Indexed on 
            2010/05/13
            17:44 UTC
        
        
        Read the original article
        Hit count: 207
        
I'm creating a script with javascript which works in every browser except IE.
<script type="text/javascript">
    (function() {
        var sc = document.createElement('script');
        sc.type = 'text/javascript';
        sc.src = 'http://domain.com/script.js';
        (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(sc);
    })();
</script>
How could I get this working in IE (tested IE6, IE7, IE8)?
© Stack Overflow or respective owner