我正在打开一个空白窗口并在新窗口上编写一个 javascript 来提交表单。
当我执行一行 "newWindow.document.write(newwdtxt2);\n\"(倒数第三行) 我得到一个异常并且最后两行没有执行。下面提到的是我的代码
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; }
请帮我弄清楚是什么问题?