Difference between dataType jsonp and JSON

后端 未结 2 404
北荒
北荒 2020-12-14 18:26

I download Jquery UI autoload, looking to remote-jsonp.html. This is ajax function but i open console.. I can\'t see any request in my console...

What is difference

2条回答
  •  伪装坚强ぢ
    2020-12-14 18:31

    dataType: jsonp for cross-domain request, that means request to different domain and dataType: json for same domain-same origin request.

    Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.

    Read about same origin policy

    Read more about jQuery AJAX

提交回复
热议问题