[英]Ajax and php redirection
This is what I try to do: 这是我尝试做的:
Problem : 问题:
I cannot redirect my php answer to ajax, probably due to cross domain protection. 由于跨域保护,我无法将我的php答案重定向到ajax。
What can I do? 我能做什么?
I don't want use file_get_contents
because the resource on server B can be quite heavy so I don't want download it twice (once by serverA, second by client) 我不想使用
file_get_contents
因为服务器B上的资源可能很重,所以我不想两次下载(一次由serverA,一次由客户端)
just get a response from server which consists of js code to redirect you to the required URL 只需从包含js代码的服务器获取响应即可将您重定向到所需的URL
for example 例如
echo "<script> window.location=url_to_redirect;</script> ";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.