Cross-origin and JSONP of AJAX (the function of automatically adding a short address to an article) _ jquery

Source: Internet
Author: User
Cross-origin and JSONP of AJAX (another function to automatically add a short address for the article) What is AJAX cross-origin request
For the sake of security, if you want to request the content of another website www. B .com via Ajax from www.a.com, the browser does not allow you to do this (I do not understand what security here refers? Think about what hackers can do without this restriction ). Under what circumstances is cross-origin? Domain names are different. For example, if a.com sends a request to B .com, this is, of course, cross-domain. This is not allowed. However, different subdomain names (for example, sub.a.com sends requests to www.a.com) or even different ports of the same domain name (for example, a.com: 80 sends requests to a.com: 8080) are also cross-domain.
The following is an example of cross-origin:

The Code is as follows:


Related Article

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.