有关_self和opener的问题
cj217 2003-07-18 01:31:51 在下面的程序中,
function result(s)
{
s = String(s);
this.content = s;
this.win = window.open("result.htm","_self");
this.see = function() {
win.document.all.title.innerHTML = this.title;
}
}
打开了一个窗口,result.htm,用了_self标签,以保证在原窗口上打开,而不是弹出一个新窗口。
接下来,在result.htm中
<body onLoad="opener.see();">
这一句,会提示opener为空或不是对象。
我的判断是opener所指的母窗口不存在了,原因是_self的影响。如果没有用_self,则程序不会出错。
请教如何改正这个错误?谢谢!!!!