Sharing Top Content from the Angular-sphere.

AngularJS JSONP GET Example

An #AngularJS JSONP GET Example  #angular

  • This is an example of a cross domain GET request using JSONP, the most common way to get data.
  • Like the previous example using CORS, this too uses requires the server to be ‘aware’ of request so it can reply with the JSONP callback method.
  • The “P” in the JSONP actually stands for padding, which really means “Named Function”.
  • You pass along a named javascript function that tells the server to wrap its response and when it responds your data is neatly wrapped with a helper function.
  • This method does require control over the request destination, or the site itself has to support a JSONP callback.

AngularJS JSONP GET Example

@ArroyoLabs: An #AngularJS JSONP GET Example #angular

AngularJS JSONP GET Example

This is an example of a cross domain GET request using JSONP, the most common way to get data. Like the previous example using CORS, this too uses requires the server to be ‘aware’ of request so it can reply with the JSONP callback method.

The “P” in the JSONP actually stands for padding, which really means “Named Function”. You pass along a named javascript function that tells the server to wrap its response and when it responds your data is neatly wrapped with a helper function. This gets around the Same Origin Policy since

Comments are closed, but trackbacks and pingbacks are open.