使用POST进行Ajax重定向

编程入门 行业动态 更新时间:2024-10-27 20:30:01
本文介绍了使用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重定向

本文发布于:2023-10-10 12:02:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1478616.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   POST   Ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!