Create dynamic script - IE doesn't work
- by poru
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)?