I have a script running in the head of my html document and it works in every browser except for internet explorer. Tested in Opera, Safari, Chrome, Firefox, Internet Explorer.<
Try document.getElementsByTagName('head')[0] instead of document.head
document.getElementsByTagName('head')[0]
document.head