使用POST进行Ajax重定向 [英] Ajax redirect using POST

查看:131
本文介绍了使用POST进行Ajax重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在成功的Ajax调用之后,他已经看到了很多有关如何重定向到另一个页面的答案,但是它们都使用GET方法. 相反,我想使用POST方法将参数传递到新页面. 我该怎么办?

He have seen a lot of answers on how to redirect to a different page after a successful Ajax call, but all of them uses a GET method. I'd like, instead, to pass my parameters to the new page using the POST method. How can i do it?

推荐答案

好吧,我之前已经遇到过这个问题,唯一的解决方法(也许是我错了)是通过定义AJAX成功回调函数并从该回调函数.如果需要,您可以在AJAX响应中发送回重定向URL本身,并在回调函数中读取重定向URL.

Well i have faced this issue before and the only way to do this seems(maybe i am wrong) to be by defining a AJAX success callback function and redirect from that callback function. If you want you can send back the redirect url itself in the AJAX response and read the redirect URL in the call back function.

这篇关于使用POST进行Ajax重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆