Prevent error on write script tag after document complete ready state. Needs for ie8, which works correct, but writes scripts after complete.