jsonp

3 questions about JSON-P format.

Hi, I have to write a script which will be hosted on differents domains. This script has to get information from my server. So, stackoverflow's user told me that i have to use JSON-P format, which, after research, is what i'm going to do. (the data provided in JSON-P is for displaying some information hosted on my server on other websi...

Problem with accessing in DOM with jQuery

Hello, I changed the tree of my JSON-P output, and i cannot access to my object DOM anymore : Here's my output : jsonp1271634374310( {"Inter-Medias": {"name":"Inter-Medias","idGSP":"14","average":"80","services":"8.86"} }); And here's my jQuery script : success: function(data, textStatus, XMLHttpRequest){ widget = data.name; w...

Copying cookies cross-domain, why is IE blocking cookies other browsers are sending with the SCRIPT tag

Trying to copy a cookie from second.com to first.com, with full control of both domains. Previously an iFrame was used, however this is not able to work across all browsers as it touched on 'third-party cookies' which are hard to implement and impossible in Safari and Chrome. The new approach uses a SCRIPT tag pointing to second.com an...

Is there an existing tool for jsonp like fetching of xml in jquery?

Hi, For a web service I'm developing I would like my embedded code (on the client's site) to fetch an xml file from my sever script which resides on my domain. As this is a cross-domain request I figured to use jsonp as it seems the de facto standard for such apis. However, for my application it would be easier for me to use xml inste...

jsonp with jquery

Can you give a very simple example of reading a jsonp request with jquery? I just can't get it to work. ...

Post data to JsonP

Hi 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 to send via the querystring What are the options for getting around this? thanks ...

Accessing Remote ASP.NET Web Services' JSON data

How can I best create a webservice method which returns JSON data that is to be consumed by an application on a different domain? The following article talks about how to set it up: http://www.codeproject.com/KB/webservices/ASPNET_JSONP.aspx I havent tried it out yet but it seems like there are a lot of steps and the ajax client has to...

jsonp cross domain only working in IE

EDIT: At first I thought it wasn't working cross domain at all, now I realize it only works in IE I'm using jQuery to call a web service (ASP.NET .axmx), and trying to us jsonp so that I can call it across different sites. Right now it is working ONLY in IE, but not in Firefox, Chrome, Safari. Also, in IE, a dialog pops up warning ...

Twitter Search API is returning weird characters - is it me or is it them?

We are building an app that accesses the Twitter search over JSONP. It mostly works fine, but occasionally the request returns a JSONP callback that consists of weird unparseable characters. Here is an example: http://search.twitter.com/search.json?result_type=recent&rpp=100&geocode=51.4375857,-0.1658648,1km&page=5&call...

JSONPBehaviour and multiple formats from WCF service.

Hi, I have a WCF service which I would like to product XML and JSON depending on the URI template. So in my service contract I have methods like the following [ServiceContract] public interface MultiFormatContract { [OperationContract] [WebGet(UriTemplate="/json/data", ResponseFormat = WebMessageFormat.Json)] [JSONPBehavior(callb...

jquery $.ajax call succeeds but returns nothing. (jsonp)

$(document).ready(function() { $('#button').click(function() { try { var json = $.ajax({url : 'http://www.example.com/experimental/service.php', type : 'jsonp', success : function() {alert('success')}}); alert(json); } catch(err) { alert(err.description) } var sjson = JSO...

$.each() iterating over characters in a string - do I need to eval()?

I have json data being returned as a collection: var foo = ["6", "7", "33"] using JSONP in jQuery. Since I'm using JSONP, the data is being returned to a callback function, which is interpreting it as a string instead of a collection. Do I need to run eval(foo) on the string in the callback before handling it as a collection, or is ...

how to kill an older jsonp request?

I have a cross-domain long polling request using getJSON with a callback that looks something like this: $.getJSON("http://long-polling.com/some.fcgi?jsoncallback=?" function(data){ if(data.items[0].rval == 1) { // update data in page } }); The problem is the request to the long-polling service ...

How does this cross-domain request work ?

$.ajax( { url : "http://search.twitter.com/search.json?q=google&lang=en&rpp=10&since_id=&callback=?", dataType : 'json', success : function(data) { alert(data.results.length); } }); How exactly is this working ? I mean the cross-domain request. ...

jsonp is not firing beforeSend?

Hi All, I am working on a project to call a webservice from different domain using $.ajax with dataType set to jsonp. $.ajax({ type: "GET", url: testService.asmx, async: true, contentType: "application/json; charset=utf-8", dataType: "jsonp", beforeSend: function (XMLHttpRequest) { ...

ASP.NET MVC 2 JSONP with MVC Futures

I´m using mvc futures 2 with WebApiEnabled for XML and JSON support. But due to cross domain issues with jQuery $.ajax I´m lookin in to JSONP. Is there a simple way to extend futures rest function for JSONP or should I do something else. Do anyone have some hints on this subject ? ...

Do I need to sanitize the callback parameter from a JSONP call?

I would like to offer a webservice via JSONP and was wondering, if I need to sanitize the value from the callback parameter. My current server side script looks like this currently (More or less. Code is in PHP, but could be anything really.): header("Content-type: application/javascript"); echo $_GET['callback'] . '(' . json_encode($d...

Why is alert not run even though $.getJSON runs fine? (Callback not executed, even though the request works fine with getJSON)

I have a snippet of code such as: $.getJSON("http://mysite.org/polls/saveLanguageTest?url=" + escape(window.location.href) + "&callback=?", function (data) { var serverResponse = data.result; console.log(serverResponse); alert(serverResponse); }); It works fine in the sense that it makes a ...

JSONP & jQuery Chunking

Hi Guys, I am wanting to utilize JSONP for a project with x-domain scripting but little concerned with the 2048 character limit in IE. Does JSONP support "chunking" automatically if character size exceeds 2048 ? If yes, does anyone have any examples they can share ? Thx ...

AJAX XMLHttpRequest POST X-Domain

Hi Guys, I am sending an AJAX request using POST over X-Domain for a widget we are producing for our website. The problem we are facing is that this is getting blocked. My question is - for "modern browsers" [Chrome, Safari, FF, IE8] - it is my understanding that setting "Access-Control" headers Access-Control-Allow-Origin: http://www...