以下是我写的一个JS的方法,加在了按钮点击事件里.如果window.open(url,'_blank',windowprops);处的URL,换成了'',就可以实现后面对新窗口写文字的操作.如果是给了一个URL,后面对新窗口写内容的操作就无效,请高手指点.我想给新弹出的窗口更换标题栏.
<script type="text/javascript">function popupPage(l,t,w,h){
var windowprops="location=no,scrollbars=auto,menubar=yes,toolbars=no,titlebar=no,resizable=yes"+",left="+l+",top="+t+",width="+w+",height="+h;var url="ftp://192.168.0.1/DownLoad";whatsNew = window.open(url,'_blank',windowprops);
whatsNew.document.write(' <center> <b>更新通知 </b> </center>');
whatsNew.document.write(' <p>最后更新日期:00.08.01');
whatsNew.document.write(' <p>00.08.01:增加了“我的最爱”栏目。');
whatsNew.document.write(' <p align="right">' +
' <a href="javascript:self.close()">关闭窗口 </a>');
whatsNew.document.close();}
</script>
<script type="text/javascript">function popupPage(l,t,w,h){
var windowprops="location=no,scrollbars=auto,menubar=yes,toolbars=no,titlebar=no,resizable=yes"+",left="+l+",top="+t+",width="+w+",height="+h;var url="ftp://192.168.0.1/DownLoad";whatsNew = window.open(url,'_blank',windowprops);
whatsNew.document.write(' <center> <b>更新通知 </b> </center>');
whatsNew.document.write(' <p>最后更新日期:00.08.01');
whatsNew.document.write(' <p>00.08.01:增加了“我的最爱”栏目。');
whatsNew.document.write(' <p align="right">' +
' <a href="javascript:self.close()">关闭窗口 </a>');
whatsNew.document.close();}
</script>
在新窗口中打开链接。
function popupPage(l,t,w,h){
var windowprops="location=no,scrollbars=auto,menubar=yes,toolbars=no,titlebar=no,resizable=yes"+",left="+l+",top="+t+",width="+w+",height="+h;var url="ftp://192.168.0.1/DownLoad";whatsNew = window.open(url,'_blank',windowprops);
whatsNew.document.write(' <center> <b>更新通知 </b> </center>');
whatsNew.document.write(' <p>最后更新日期:00.08.01');
whatsNew.document.write(' <p>00.08.01:增加了“我的最爱”栏目。');
whatsNew.document.write(' <p align="right">' +
' <a href="javascript:self.close()">关闭窗口 </a>');
whatsNew.document.close();} 楼上的回答我没明白............我的意思是点击按钮弹出一个窗口,我在URL里已经给了新窗口所到的连接(请看我提问的代码),但如果给了URL,就无法在新窗口中写内容....
获取新打开的窗口对象,再对该对象操作