在点击关闭按钮
后,当前窗口在Firefox
中无法关闭,但在IE
中可以正常工作。
function closeWin() {
var d=window.opener;
try {
var param="";
var winHref=d.document.location.href;
if(winHref.indexOf("?") > -1){
param=winHref.substr(winHref.indexOf("?"));
}
//d.document.location.href=d.document.forms[0].thankyouurl.value+'?'+param;
d.document.location.href=d.document.getElementsByName('thankyouurl')[0].value+'?'+param;
}
catch(e){}
finally{}
window.close();
return true;
}
<input type="button" name="Button" value="Close" onClick="return closeWin();">