jQuery AJAX 抛出的 302 错误代码是什么?

发布于 2024-08-05 22:27:46 字数 305 浏览 3 评论 0原文

我正在使用 ASP.NET MVC 和 jQuery,并且我有一个在每个页面上重复的 UserControl。在每个页面请求中,都会发生 AJAX 回调。到目前为止,一切都很好。

但是当我在 localhost 中发布网站时,我注意到这个 AJAX 抛出了 302 错误。这只发生在 https 页面上,并且仅在 FF 和 Chrome 中发生。在 IE 上,AJAX 请求工作正常。

这个302错误是什么?为什么只出现在 https 页面上,并且只出现在 FF 和 Chrome 中?

I'm working with ASP.NET MVC and jQuery and I have a UserControl that is repeated on every page. In every page request, an AJAX callback occurs. So far so good.

But when I'm in localhost and I publish the site, I notice that this AJAX is throwing a 302 error. This only occurs on https pages, and only in FF and Chrome. On IE, the AJAX request works fine.

What is this 302 error? Why does it only occur on https pages, and only in FF and Chrome?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

请爱~陌生人 2024-08-12 22:27:46

HTTP 302 用于重定向。我的猜测是存在某种服务器错误,并且您被重定向到使用 302 的错误页面。检查服务器日志是否有错误。

HTTP 302 is used for redirection. My guess is that there is some sort of server error and you are being redirected to an error page using 302. Check the server logs for errors.

谎言 2024-08-12 22:27:46

HTTP 代码 302 表示重定向。服务器试图告诉您重定向到某个地方。

http://en.wikipedia.org/wiki/HTTP_302

HTTP code 302 represents a redirection. The server is trying to tell you to redirect somewhere.

http://en.wikipedia.org/wiki/HTTP_302

煮酒 2024-08-12 22:27:46

您访问的服务器是否具有页面重定向功能?您通过 Ajax 访问的页面被重定向到另一个页面?如果是这种情况,您可以禁用重定向(至少忽略该页面的重定向),然后尝试一下。
PS:我认为Ajax可能不支持url重定向。

Does the server you accessing has Page Redirection facility? and that the page you access by Ajax was redirected to another page? If that is the case, you'd disable the redirection(at least ignore redirection for that page) then give it a try.
PS: I think Ajax may not support url redirection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文