The code is like this:
var script = document.createElement('script');
//script.type = 'text/javascript'; // do I need this ?
script.src = src;
document.body.appendChild(script);
The second line has been commented out because it makes no difference to have it.
Or am I missing something ?
Thanks,
No: The default value of
typeis already set to JavaScript (“text/javascript”). The type attribute is a property of the SCRIPT tag to allow Vbscript, for example, which is only supported by IE.The
typeattribute has also become optional in HTML5. This could be an encouragement to omit thetypeattribute of thescriptelement.