这次还是弹出窗口问题 我用window.open弹出了一个窗口,现在的要求是在这个窗口中 点击 button, 更新数据库,之后这个窗口关闭,接着父窗口自动刷新,怎么做 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 button 获取点击click事件,执行数据库操作(可以用ajax),然后控制当前窗口关闭 ,然后控制父窗口刷新。 好吧page.html<html> <body> <script> function openw(){ window.open("page1", "_blank", "height=600, width=800"); } </script> <input type="button" onclick="openw()"> </body></html>page1.html<html> <body> <script> <input type="button"> </body></html>就这么简单,,先不考虑数据处理,就单击子窗口button,,关闭子窗口,刷新父窗口 page.html<html> <script> var ChildPage; function openw(){ ChildPage = window.open("page1.html", "_blank", "height=600, width=800"); } function refrashPage(){ ChildPage.close(); window.location = window.location; } </script> <body> <input type="button" onclick="openw()" value="弹出"> </body></html>page1.html<html> <body> <script> function closeAndfresh(){ opener.refrashPage(); } </script> <body> <input type="button" onclick="closeAndfresh()" value="关闭并刷新"> </body></html> win2003任务计划 不同时间打开不同网页 thickbox的使用问题 extjs panel 设置坐标 在网页中如何用javascript判断表单中的某个控件不存在 javascript中如何实现IE查看源码显示乱码? 百思不得其解的一段javascript程序段 關於showModalDialog打開的窗體的問題? 关于窗口问题? 高分求帮助: window.open不成功的原因?怎样确保window.open可以打开新的窗口? 关于对于响应用户鼠标划过动作的操作,求解。 文本框 readonly也能修改 javascript对象类型问题
执行数据库操作(可以用ajax),然后控制当前窗口关闭 ,然后控制父窗口刷新。
page.html
<html>
<body>
<script>
function openw(){
window.open("page1", "_blank", "height=600, width=800");
}
</script>
<input type="button" onclick="openw()">
</body>
</html>
page1.html
<html>
<body>
<script>
<input type="button">
</body>
</html>就这么简单,,先不考虑数据处理,就单击子窗口button,,关闭子窗口,刷新父窗口
<script>
var ChildPage;
function openw(){
ChildPage = window.open("page1.html", "_blank", "height=600, width=800");
}
function refrashPage(){
ChildPage.close();
window.location = window.location;
}
</script>
<body>
<input type="button" onclick="openw()" value="弹出">
</body>
</html>
page1.html
<html>
<body>
<script>
function closeAndfresh(){
opener.refrashPage();
}
</script>
<body>
<input type="button" onclick="closeAndfresh()" value="关闭并刷新">
</body>
</html>