Questions tagged [jsonp]

JSON with Padding (JSONP) is a technique for working around cross-domain Ajax limitations.

Filter by
Sorted by
Tagged with
2338votes
10answers
557kviews

What is JSONP, and why was it created?

I understand JSON, but not JSONP. Wikipedia's document on JSON is (was) the top search result for JSONP. It says this: JSONP or "JSON with padding" is a JSON extension wherein a prefix is specified ...
user avatar
  • 184k
585votes
17answers
808kviews

“Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

I'm developing a page that pulls images from Flickr and Panoramio via jQuery's AJAX support. The Flickr side is working fine, but when I try to $.get(url, callback) from Panoramio, I see an error in ...
user avatar
423votes
4answers
145kviews

Can anyone explain what JSONP is, in layman terms? [duplicate]

I know JSONP is JSON with padding. I understand what JSON is, and how to use it with jQuery.getJSON(). However, I do not understand the concept of the callback when introducing JSONP. Can anyone ...
user avatar
  • 10.1k
408votes
8answers
215kviews

What are the differences between JSON and JSONP?

Format wise, file type wise and practical use wise?
user avatar
  • 7,140
204votes
9answers
247kviews

Error handling in getJSON calls

How can you handle errors in a getJSON call? Im trying to reference a cross-domain script service using jsonp, how do you register an error method?
user avatar
  • 7,178
193votes
4answers
389kviews

Basic example of using .ajax() with JSONP?

Please could someone help me work out how to get started with JSONP? Code: $('document').ready(function() { var pm_url = 'http://twitter.com/status'; pm_url += '/user_timeline/stephenfry....
user avatar
  • 5,809
145votes
7answers
640kviews

Access-Control-Allow-Origin error sending a jQuery Post to Google API's

I read a lot for the 'Access-Control-Allow-Origin' error, but I don't understand what I have to fix :( I'm playing with Google Moderator API, but when I try to add new serie I receive: ...
user avatar
  • 7,880
136votes
15answers
64kviews

JSONP with ASP.NET Web API

I am working on creating a new set of services in ASP.MVC MVC 4 using the Web API. So far, it's great. I have created the service and gotten it to work, and now I am trying to consume it using ...
user avatar
  • 4,863
129votes
12answers
107kviews

How to make a JSONP request from Javascript without JQuery?

Can I make a cross-domain JSONP request in JavaScript without using jQuery or other external library? I would like to use JavaScript itself and then parse the data and make it an object so I could use ...
user avatar
  • 1,291
123votes
12answers
145kviews

IE9 jQuery AJAX with CORS returns "Access is denied"

The following works in all browsers except IE (I'm testing in IE 9). jQuery.support.cors = true; ... $.ajax( url + "messages/postMessageReadByPersonEmail", { ...
user avatar
  • 11k
122votes
2answers
51kviews

Best content type to serve JSONP?

I have a webservice that when called without specifying a callback will return a JSON string using application/json as the content type. When a callback is specified it will wrap the JSON string in a ...
user avatar
  • 23.8k
113votes
8answers
213kviews

parsing JSONP $http.jsonp() response in angular.js

I am using angular's $http.jsonp() request which is successfully returning json wrapped in a function: var url = "http://public-api.wordpress.com/rest/v1/sites/wtmpeachtest.wordpress.com/posts?...
user avatar
  • 2,387
112votes
5answers
47kviews

So, JSONP or CORS? [closed]

My WebAPI was deployed in the Intranet environment. That means security was not my concern. It seems that CORS is much more friendly to the client and easier to implement. Any other concerns I might ...
user avatar
  • 3,072
103votes
7answers
97kviews

Post data to JsonP

Is it possible to post data to JsonP? Or does all data have to be passed in the querystring as a GET request? I have alot of data that I need to send to the service, cross domain, and it is too large ...
user avatar
  • 10.5k
89votes
7answers
50kviews

jQuery ajax (jsonp) ignores a timeout and doesn't fire the error event

To add some basic error handling, I wanted to rewrite a piece of code that used jQuery's $.getJSON to pull in some photo's from Flickr. The reason for doing this is that $.getJSON doesn't provide ...
user avatar
  • 3,108

15 30 50 per page
1
2 3 4 5
273