点击即可关闭 本页的javascript代码

来源:百度知道 编辑:UC知道 时间:2024/09/28 15:36:02
登录成功后 出现alert(‘登录成功’),等我点击确定时,关闭本页然后 刷新上一页(或另一页),该怎么做?在线等,追加分
1楼你可以去*了
2楼的你说详细点啊,先关闭本页然后刷新父页
什么叫模态和非模态啊

alert('登录成功!');
window.close();
window.opener.document.location.reload();//如果父窗口要提交参数,就用下面这个
//window.opener.document.location = "链接";

然后把网站关了 重新点开登陆的那个
这时 你已经登陆上了。。。。
就出现你想要的 然后已经登陆完成
你可以进行操作了

非模态刷新父页面:window.opener.location.reload();
模态刷新父页面:window.dialogArguments.location.reload();

self.close();

分太少了没兴趣回答。。。。