How to add script files in child window using javascript?
Consider the following code:
myWindow = window.open(\"\", \"\", \'width=650,height=700,menu
Supposing you don't have domain crossing, you may simply do this (using jquery) :
$(childwindow.document.body).append('<script src="..."></script>');
But a more detailed question might enable more on topic answers.
Basically:
var win, doc;
win = window.open('', 'dialog', opts);
doc = win.document;
doc.write(
"<html><head>"
+ "<script type='text/javascript' src='path/to/your/script.js'></script>"
+ "<script type='text/javascript'>"
+ "/* this is inline script inserted by JavaScript, below is a function converted to it's string representation */"
+ someFuncInVariable.toString()
+ "</script>"
+ "</head><body>"
+ "</body></html>"
);
doc.close();