Content is not executed because the element has an src attribute. It is not strictly legal as it is. HTML5 specification says:
If the src attribute exists, this element must be empty or contain only script documentation that also meets the script's content limits.
The content of this <script> element is not valid JSON or valid JavaScript. This is not valid JSON because property names are not quoted. It is not valid JavaScript because, although it looks like a block expression with marked instructions, the colon after startInNewWindow cannot legally appear there.
However, a loadable script can always search for the last element of a script and parse its contents:
var scripts = document.getElementsByTagName('SCRIPT'); var lastScript = scripts[script.length - 1]; var content = eval(lastScript.innerText || lastScript.textContent);
source share