w = window.open("", window_name, 'toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1,copyhistory=0,width=900,height=600,top='+yOffset+',left='+xOffset+'');
w.document.write("<html><body><form method='POST' NAME='cForm' ID='cForm' enctype='multipart/form-data' >");
第二条语句出错,w为undefined,document对象为空,请问这里可以怎样做,谢谢啦!
w.document.write("<html><body><form method='POST' NAME='cForm' ID='cForm' enctype='multipart/form-data' >");
第二条语句出错,w为undefined,document对象为空,请问这里可以怎样做,谢谢啦!
这句话有错
var window_name = '_blank';
var xOffset = 100, yOffset = 20;w = window.open("", window_name, 'toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1,copyhistory=0,width=900,height=600,top=' + yOffset +',left='+xOffset+'');
w.document.write("<html> <body> <form method='POST' NAME='cForm' ID='cForm' enctype='multipart/form-data'>"); w.document.write("xyz");</script>
<script type="text/javascript">
var w = window.open("about:blank");
var wd = w.document.open();
wd.write("hello,world!");
wd.close();
</script>
var url= "1.html";
var yOffset = 1000;
var xOffset = 2000;
debugger;
w = window.open(url, window_name, 'toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1,copyhistory=0,width=900,height=600,top='+yOffset+',left='+xOffset+'');
w.document.write(" <html> <body> <form method='POST' NAME='cForm' ID='cForm' enctype='multipart/form-data' >");
你试试吧
然后在这个页面上用document.write
不过你上面的那种想法也可以,就是这么取到打开窗口的问题,期待高手。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
var s = window.open('3.html','','height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
s.document.open();
s.document.write('<div style="color:red">=============================</div>');
s.document.close();
</script>
</head>
<body>
</body>
</html>
3.html这个页面为空
var w = window.open("","test");
setTimeout("w.document.write('aaaaaaaaa');",1000);
若有问题,就是其它方面的问题了.
http://blog.csdn.net/zhiqiangzhan/archive/2009/10/17/4686071.aspx#window