-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[js] 第104天 请说说json和jsonp的区别? #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
json是一种数据结构
|
json是一种数据类型,一般前后端之间传递数据是通过json类型来实现的。 jsonp是一种用于跨域的技术。 jsonp可以跨域的原因大致如下:script标签可以实现跨域,而且可以跨域执行js文件,因此可以插入script标签来引入js文件,通过动态生成js文件,客户端通过执行js文件中的函数,获取返回值来得到需要的数据。 优点是兼容性较佳,支持服务器和浏览器的双向通信,缺点是只支持get请求。 |
json一种轻量级的数据交换格式 jsonp一种实现跨域的方式 |
json是一个轻量级数据格式,jsonp是一种跨域解决方案 关于jsonp:
get请求 |
jsonp是解决跨域的方式,通过动态生产script获取目标数据,而json是一种跨平台通用数据格式,两者可以说没有联系。 |
json是数据格式,jsonp是解决跨域的一种方式,通过动态script来获取数据,只支持get请求。 两者之间没有任何联系 |
第104天 请说说json和jsonp的区别?
The text was updated successfully, but these errors were encountered: