javascript在提交时关闭弹出窗口
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javascript在提交时关闭弹出窗口,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1192字,纯文字阅读大概需要2分钟。
内容图文
好.我已经看到这个问题已经超过10年未得到答复了..
如何在一键通话中提交和关闭弹出窗口.
建议如此运行.
function saveNClose()
{
document.form.submit();
self.close();
}
this doesn't work because the submit has a redirect, and the self.close is never reached.
function closeLaterNSaveNow();
{
setTimeout("window.close()",5000);
document.form.submit();
}
same problem.. the close is never called because the script for the page is gone.
function closeNowNSubmit()
{
self.close();
document.form.submit();
}
the window closes, but nothing gets saved. server doesn't even get notified of anything..
<input class='btn btn-success' disabled='disabled' id='SubmitFinal' onclick='closeWindow()' type='submit' value='Finish'>
Well then there's no validation of the data. it submits before the function is called.
任何人解决这个?我找到了可以追溯到2002年的相同解决方案,有些解决方案可以追溯到本月.我会继续看,但我希望有人钉了它,有人在这里回答
解决方法:
一个典型的解决方案是输出一个JS片段,它将在提交后关闭窗口作为结果页面.
<script type="text/javascript">
window.close();
</script>
另一种解决方案是通过AJAX提交表单数据,并在请求完成时关闭窗口.您可以使用jQuery Form plugin:
$("#myForm").ajaxForm(function() {
window.close();
})
内容总结
以上是互联网集市为您收集整理的javascript在提交时关闭弹出窗口全部内容,希望文章能够帮你解决javascript在提交时关闭弹出窗口所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。