Home  >  Article  >  Web Front-end  >  Summary of cases using JSONP

Summary of cases using JSONP

php中世界最好的语言
php中世界最好的语言Original
2018-04-25 15:29:181568browse

This time I will bring you a summary of the cases of using JSONP. What are the precautions for using JSONP? The following is a practical case, let's take a look.

Both json and JSONP are still very common in development. We will not talk about JSON here.

A well-known problem, Ajax direct request for ordinary files has the problem of cross-domain unauthorized access, regardless of whether you are static pages, dynamic web pages, web services, WCF, as long as it is cross-domain Requests are never allowed, which is why JSONP is used (because 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 files with the attribute## of "src" # tags all have cross-domain capabilities, such as