表单数据发布后执行 window.close()
在为 SAP 用户开发 Punch-out 商店时,我们希望浏览器在用户单击购物车上的“提交”后关闭。
我们必须将 html 表单数据通过 HTTP 发布到目标 URL。如果我们使用 onSubmit ="window.close()" JavaScript window.close() 在提交表单之前触发,并且不会发布表单数据。
有人克服了这个问题吗?
In developing a Punch-out shop for SAP users we would like the browser to close after the user clicks submit on the shopping cart.
We have to HTTP post our html form data to a target URL. If we use onSubmit ="window.close()" the JavaScript window.close() fires before the form is submitted and the form data is not posted.
Has anyone overcome this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的答案是获取您正在提交的页面,返回一个关闭其自身的 html 页面。
简单说明一下,大多数浏览器只允许您关闭使用 window.open 打开的窗口。
The best to answer is to get the page you are submitting to, to return a html page which closes it's self
As a quick note most browsers will only let you close a window you have opened with window.open.