日期:2014-05-16  浏览次数:20450 次

问题:缺少')'
这句代码,看不出问题啊,怎么总是提示:缺少 ') '
document.writeln( "           <td   align=center> <input   type= "Button "   value= "提交 "   onClick= "javascript:window.location.href= 'http://localhost/shop/shopsearch.aspx?ProductName= '+form3.ProductName.value+ '&ClassID= '+form3.classid.options[form3.classid.selectedIndex].value+ '&BrandName= '+form3.brandname.options[form3.brandname.selectedIndex].text; "   /> </td> ");

------解决方案--------------------
里面有双引号,需要转下:
document.writeln( " <td align=center> <input type=\ "Button\ " value=\ "提交\ " onClick=\ "javascript:window.location.href= 'http://localhost/shop/shopsearch.aspx?ProductName= '+form3.ProductName.value+ '&ClassID= '+form3.classid.options[form3.classid.selectedIndex].value+ '&BrandName= '+form3.brandname.options[form3.brandname.selectedIndex].text;\ " /> </td> ");

------解决方案--------------------
你的document.write 方法用的双引号,里面又嵌套了双引号,里面的双引号应该用 \ " 表示转义