I have the follwing JavaScript.
use document.write() at the end of all JS statements. The script element is never executed after it.
document.write()
script