JSONP: Is a callback necessary?

后端 未结 4 474
说谎
说谎 2021-01-21 17:08

I\'m creating an iOS / Droid app using AJAX, jQuery, and Phonegap. The backend is a Drupal 7 site serving content via web services. I\'m a little confused about the necessity fo

4条回答
  •  青春惊慌失措
    2021-01-21 17:14

    Yes, it's required. Default function name is callback, but can be any declared function name.

    https://jar-download.com/java-documentation-javadoc.php?a=jersey-json&g=com.sun.jersey&v=1.19.2

    It provides us with a way to access the returned data. It does this by having the server return JSON data wrapped in a function call (the “padding”) which can then be interpreted by the browser. This function must be defined in the page evaluating the JSONP response.

    see here

提交回复
热议问题