301重定向AJAX - 重定向? [英] 301 redirect on AJAX -- redirected?
问题描述
我有一个AJAX调用,做了301重定向到同一页面的服务器端点,但与尾部斜杠。
I have an AJAX call to a server endpoint that does a 301 redirect to the same page, but with a trailing slash.
时,是否调用AJAX或者它忽略他们的浏览器跟踪重定向?在我的情况下,它并没有跟着他们,但我想它可能是从服务器配置的东西。
Does the browser follow redirects when called with AJAX or does it ignore them? In my case it doesn't follow them, but I figured it might be something from the server config.
推荐答案
如果你正在使用jQuery你可以看看下面的问题来实现它。默认情况下,在默认情况下的jQuery(以及大多数图书馆与阿贾克斯)不按重定向:
If you are using jquery you could look at the questions below to implement it. By default jQuery (and most libraries with Ajax) don't follow redirects by default:
<一个href="http://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call">How管理一个jQuery的Ajax调用后重定向请求
<一个href="http://stackoverflow.com/questions/8238727/how-to-$p$pvent-ajax-requests-to-follow-redirects-using-jquery">How以prevent Ajax请求遵循使用jQuery 重定向
这篇关于301重定向AJAX - 重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!