Ajax request can not redirect the problem to explore and solve "reference, reference"

Source: Internet
Author: User

"Statement" This article is to solve the personal project encountered in the AJAX request and redirect problems, referring to a number of netizens blog and comments, thank these netizens!

1. Reasons and Solutions (refer to users, only for later query)

Response.sendredirect do the principle of steering, it is actually sent to the browser a special header, and then by the browser to do the steering, to the specified page, so when using Sendredirect, the browser address bar can see the change of address.

While the AJAX request is a partial refresh, the default is not to support redirection or forwarding, so the request needs to be judged:

Example of a rights interceptor code:

Page to set the global JS, overriding the Ajax complete method

Finally, add Rightajax to the AJAX request before you need to make a permission decision to show the results.

Ajax request can not redirect the problem to explore and solve "reference, reference"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.