How to run javascript in hidden header to include and run external javascript files?
Using
document.createElement('script');
var js = documemnt.getElementsByTags('head')[0];
js.src = "file.js"; // File location
js.type = text/javascript;
and
head.appendChild(js);
to add to head section.
I want to execute the javascript code in the similar way to add to head hidden behind to execute and .removeChild()
to remove the code after code executed.
Please tell me how to execute the code on hidden head.
Edited//
The example use ScriptManager
, Referene:public final class ClientScriptManager, to handle the client side scripts to hide javascript and run,
Call to javascript Function from code behind using ScriptManager.RegisterStartupScript.
There is no reference of it also, but with asp.net. Please tell me how to use them only on javascript without asp.net, "because it makes only slower to use asp without any commercial uses."