使用javascript打开一个窗口,我想在此窗口里设置一个背景图片?请各位教教在下.
如何才能在我打开的窗口中设置好背景图片呢?
试了好久没有用,
代码如下:
OpenWindow=window.open("", "newwin", "height=100, width=400,toolbar=no,scrollbars='+scroll+',menubar=no,top=500,left=400"); //写成一行
OpenWindow.document.write("<html>");
OpenWindow.document.write("<head>");
OpenWindow.document.write("<TITLE>例子</TITLE>");
OpenWindow.document.write("</head>");
OpenWindow.document.write("<BODY style='BACKGROUND-IMAGE: url(file:///C:\Inetpub\wwwroot\javajpg\背景screenchoice.jpg)'><form name='form2'>");
OpenWindow.document.write("<br>");
结果这样设置没有反应?请大家指点一下.
OpenWindow.document.write("<input type='radio' name='channel' value='1' >");
OpenWindow.document.write("<input type='radio' name='channel' value='2' >");
OpenWindow.document.write("<input type='radio' name='channel' value='4' >");
OpenWindow.document.write("<input type='radio' name='channel' value='8' >");
OpenWindow.document.write("<br>");
OpenWindow.document.write("<input type='button' name='confirm' value='confirm' onclick='opener.covertnumber()'>");
OpenWindow.document.write("<input type='button' name='cancel' value='cancel' onclick='window.close()'>");
OpenWindow.document.write("</form2></BODY>");
OpenWindow.document.write("</HTML>");
OpenWindow.document.close();