PHP analysis of ajax cross-domain issues

小云云
Release: 2023-03-21 06:04:01
Original
1147 people have browsed it

In fact, there are many explanations about JSONP on the Internet, but they are all the same and vague. It is a bit difficult for many people who are new to it to understand. It is not a small thing, but I try to explain this problem in my own way. See if that helps. This article mainly shares with you PHP's analysis of ajax cross-domain issues, hoping to help everyone.

1. A well-known problem, Ajax direct request for ordinary files has the problem of cross-domain unauthorized access. Regardless of whether you are a static page, dynamic web page, web service, or WCF, as long as it is a cross-domain request, it will not be allowed. Accurate;

2. However, we also found that when calling js files on a Web page, it is not affected by whether it is cross-domain (not only that, we also found that all tags with the "src" attribute have cross-domain capabilities, such as

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!