I am opening a blank window and writing a javascript on the new window to submit a form.
when I execute a line "newWindow.document.write(newwdtxt2);\n\"(3rd line from last) I get an exception and last two lines do not execute. Below mention is my code
function openWindow(url,name,options) {
var aToken = "";
aToken ="2121225434349231132674638921:SUPER.SUPER";
if(aToken=="") {
aToken=document.formEMS.AUTHTOKEN.value; }
var newWindow = window.open("", name);
if (!newWindow) return false;
var newwdtxt = "";
newwdtxt += "<html><head></head>\n";
newwdtxt += "<body>\n";
newwdtxt += "<form name=\"eventForm\" method=\"post\" action="+url+ ">\n";
newwdtxt += "<input type=\"hidden\" name=\"AUTHTOKEN\"";
newwdtxt += "value= '";newwdtxt += aToken+"'/>\n";
newwdtxt += "</form>\n";
newwdtxt += "<scr";
var newwdtxt1 = "";
newwdtxt1 += "ipt type=\"text/javascript\" language=\"javascript\">\n";
newwdtxt1 += "window.onLoad=document.eventForm.submit();\n";
newwdtxt1 += "</scr";
var newwdtxt2 = "";
newwdtxt2 += "ipt>\n";
newwdtxt2 += "</body></html>\n";
newWindow.document.write(newwdtxt);
alert(newwdtxt);
newWindow.document.write(newwdtxt1);
alert(newwdtxt1);
alert(newwdtxt2);
newWindow.document.write(newwdtxt2);
alert('wrote newwdtxt2');
return newWindow; }
Please help me to figure out what is the problem?