这还有说吗,当然不行啊
你这个地方,就是把作用域设置成了newWin.document,自然里面的方法,属性都是属于newWin.document的了,newWin.document.document这是没有的啊
with([color=red]newWin.document[/color]){
write("hello"+n.value);
write("");
write("close");
}
如果你想加上document,就改写一下
with([color=red]newWin[/color]){
document.write("hello"+n.value);
document.write("");
document.write("close");
}
我看你写的那个,并不是加了document就显示不出文字吧,应该是加了document的话就在那张原来的页面上显示hello和close的button了吧,如果是write的话就应该在新打开的那张页面上有hello和close的button了吧,document是获取本页面的!所以加了document的话就是在本页面做改动!