使用 jQuery 将页面从表单加载到模态窗口
我正在开发一个包含购买流程的网站。我有一个由 PHP 生成的表单,如下所示:
<form name="order_form" action="'.$thePayreadApi->get_server_url().'" method="post" id="payer-form">
'.$thePayreadApi->generate_form().'
<input type="submit" value="Klicka för betalning" />
</form>';
提交表单后,它将转到执行购买的新页面(位于另一台服务器上)。
基本上我想要的是通过 AJAX 提交表单,然后在模态窗口中加载新页面。我在整个网站中使用 jQuery,所以我想要一个基于该库的解决方案。
我发现这些网站可能是一个提示:
http://pixeline.be/blog/2008/javascript-loading-external-urls-in-jqmodal-jquery-plugin/ http://dev.iceburg.net/jquery/jqModal/
非常感谢任何帮助!
I´m working on a website with a purchase process. I have a form generated by some PHP that looks like this:
<form name="order_form" action="'.$thePayreadApi->get_server_url().'" method="post" id="payer-form">
'.$thePayreadApi->generate_form().'
<input type="submit" value="Klicka för betalning" />
</form>';
When the form is submitted it will go to a new page (located on another server) where the purchase is performed.
Basically what I want is the form to be submitted through AJAX and then load the new page in a Modal Window. I use jQuery throughout the website so I´d like a solution based on that lib.
I´ve found these sites that might be a hint:
http://pixeline.be/blog/2008/javascript-loading-external-urls-in-jqmodal-jquery-plugin/
http://dev.iceburg.net/jquery/jqModal/
Any help is really appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有完全尝试过,但这个理论是我想要的:
I haven't tried this exactly, but the theory is what I would go for: