I have a need to include a javascript file inside another javascript function. I dont have any html file. I am executing the javascript code inside a .NET program like this
MSScriptControl.ScriptControl js = new MSScriptControl.ScriptControl();
js.AllowUI = false;
js.Language = "JScript";
js.Reset();
js.AddCode(@"
function test(x)
{
return x+10;
}
");
I need to reference a javascript file inside the function test. Can someone help me out?
Thanks
There are no such instruction like ‘include’ in javascript language. So, to accomplish what you want you have to read another script content and concatinate it with the rest of code;
The code would be something like that: