An approach to the problem of Ajax cross-domain

Source: Internet
Author: User

The solution of Ajax cross-domain problem is divided into 3 kinds:

1. Browser restrictions
Solution: Don't let the browser make restrictions
Workaround: Let the browser not do cross-domain validation by specifying parameters
Evaluation: The value is not big, need everyone to make changes, and change is the client's changes

2.XHR Request
Solution: Do not use XHR
Workaround: JSONP
Cons: Unable to meet existing development requirements

3. Cross-domain (important)
Solution Ideas:
(1) The callee modifies the code so that it supports cross-domain
(2) Caller hides cross-domain
Solution Ideas:
(1) By modifying the returned information, the callee adds some fields that allow callers to call, allowing cross-domain validation as long as cross-domain checksums are passed through the browser
(2) Use the proxy to transfer to the specified URL

An approach to the problem of Ajax cross-domain

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.