Fixed IE8 throwing unknown runtime error

Updated code in src folder as well.
innerHTML cannot be modified in IE8, and document.head is only supported
by modern HTML5 compliant browsers.