Home > Web Front-end > JS Tutorial > body text

Analyzing jsonp cross-domain access from both front-end and back-end perspectives

坏嘻嘻
Release: 2018-09-13 17:02:27
Original
1445 people have browsed it

Extensions to verify legality in php5. In PHP5.2, legality can be verified through the built-in extension filter.

1. What is cross-domain access

For example: In website A, we hope to use Ajax to obtain specific content in website B. If website A and website B are not in the same domain, then there will be a cross-domain access problem. You can understand that two domain names cannot send requests or request data across domain names, otherwise it will be unsafe. Cross-domain access violates the same origin policy. For detailed information on the same origin policy, you can click on the following link: Same-origin_policy;

In short, the same origin policy stipulates that the browser's ajax can only access the same HTML page as its Source (same domain name or IP) resources.

2. What is JSONP

JSONP (JSON with Padding) is a "usage mode" of JSON that can be used to solve the problem of cross-domain data access by mainstream browsers.

Due to the same-origin policy, generally speaking, web pages located at server1.example.com cannot communicate with servers other than server1.example.com, and HTML's

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!