JSONP 请求和 AJAX 请求有什么区别?
What is the difference between an JSONP request and AJAX request?
我一直在寻找上述解决方案的答案,但没有找到有趣的东西。
大佬们能说清楚吗??
Ajax 是一个通用术语,意思是 "Making an HTTP request and processing its response, from JavaScript, without leaving the page"。
JSONP 是 a specific means of making an Ajax request that is performed by adding a <script>
element that loads an external JavaScript program that does nothing except call a specified function with some data as the first argument. It is a hack to get around the Same Origin Policy. (It is obsolete in the face of CORS,它提供了一种更安全、更精致的方法来做同样的事情。
我一直在寻找上述解决方案的答案,但没有找到有趣的东西。 大佬们能说清楚吗??
Ajax 是一个通用术语,意思是 "Making an HTTP request and processing its response, from JavaScript, without leaving the page"。
JSONP 是 a specific means of making an Ajax request that is performed by adding a <script>
element that loads an external JavaScript program that does nothing except call a specified function with some data as the first argument. It is a hack to get around the Same Origin Policy. (It is obsolete in the face of CORS,它提供了一种更安全、更精致的方法来做同样的事情。