jsonp

ASP.NET + JSON + C#.NET or VB.NET: Problem deserializing date time with JSON WCF WebService....

I'm getting datetime in JSON format as - "\/Date(1261413600000+0530)\/" From code behind, I'm using DataContractJsonSerializer.ReadObject method to deserialize data. Converted data time is not correct. How to parse correct JSON date time from code behind? ...

How do I create a random method name

I plan on using JSONP to call an external webservice to get around the fact that I dont want to create a global function that could potentially conflict with the calling page. I thought that creating a random function name and passing it up would work. Something like this: <script src="www.foo.com/b?cb=d357534"> where cb is the callb...

How can I use JSONP to download client-side javascript objects?

I'm trying to get client-side javascript objects saved as a file locally. I'm not sure if this is possible. The basic architecture is this: Ping an external API to get back a JSON object Work client-side with that object, and eventually have a "download me" link This link sends the data to my server, which processes it and sends it b...

jQuery/JSONP widget and jQuery version conflict

I would like to create a widget so that my visitors can display it on their blog/website. I would like to use jquery and jsonp to develop this widget. I know how to avoid conflicts between jQuery and other libraries (like prototype). But what will happen if jquery is already installed on my visitors' websites and if their version is d...

Does JSONP scale? How many JSONP requests can I send before my page fills up with <script> tags?

Based on Please explain JSONP, I understand that JSONP can be used to get around the same-origin policy. But in order to do that, the page must use a <script> tag. I know that pages can dynamically emit new script tags, such as with: <script type="text/javascript" language='javascript'> document.write('<script type="text/javas...

Any way to identify a redirect when using jQuery's $.ajax() or $.getScript() methods?

Within my company's online application, we've set up a JSONP-based API that returns some data that is used by a bookmarklet I'm developing. Here is a quick test page I set up that hits the API URL using jQuery's $.ajax() method: http://troy.onespot.com/static/3915/index.html If you look at the requests using Firebug's "Net" tab (or the...

JSONP how to retrieve text

I do understand what JSON/JSONP does, but I'm not a programmer and do not know how to extract the bare basics for simple usage. I've read a lot on JSONP and lots of examples on various usage for JSONP, but I have yet to find a simple example for retrieving text from another page (e.g. http://www.domain.com/external/text.aspx). Could som...

qx.data.store.Jsonp: configureRequest not getting request as parameter

when creating an new qx.data.store.Jsonp object like this... var store = new qx.data.store.Jsonp(url, { configureRequest: function(req) { req.setParameter("key", "resources.appsrvs"); } },"callback"); ... the delegate function configureRequest does not get the request as parameter as described in qx.data.storeInterface.IStoreD...

callback execution order in jQuery getJSON

I'm trying to implement a iGoogle like dashboard interface using widgets that get their content from other sites using JSONP calls. The problem is that if the first widget that calls the "$.ajax" takes 8 seconds to get the content back, it seems that the callbacks of the other widgets will only be called after the callback of the first ...

How to Generate Embeddable Widgets, and Return PartialView, JS & CSS as JSONP?

I found this question which is a great starting point towards creating embedded widgets that enable showing dynamic content on remote sites (i.e. a different domain). One problem I'm having is with the following code: public ActionResult SomeAction() { return new JsonpResult { Data = new { Widget = "some partial html fo...

Ajax cross domain call

Hi Folks, I know about ajax cross-domain policy. So I can't just call "http://www.google.com" over a ajax HTTP request and display the results somewhere on my site. I tried it with dataType "jsonp", that actually would work, but I get a syntax error (obviously because the received data is not json formated) Is there any other possibli...

How can I validate/secure/authenticate a JavaScript-based POST request?

A product I'm helping to develop will basically work like this: A Web publisher creates a new page on their site that includes a <script> from our server. When a visitor reaches that new page, that <script> gathers the text content of the page and sends it to our server via a POST request (cross-domain, using a <form> inside of an <ifr...

Could Future Security Measures Limit JSONP's Cross-Domain Asynchronous Capabilities?

Is there a risk that future revisions of the Same Origin Policy or other browser security measures could prevent the cross-domain asynchronous request capability of JSONP? This would have to be taken into consideration if a developer intends to provide asynchronous capabilities in a public environment. ...

How to store and access JSON data for a site?

I'm buiding an HTML/jQuery site where almost all the content comes from remote JSON data. I'm having trouble coming up with a good way to store and access the data in the future (scope-wise). Currently, I've written a jQuery plugin that gets the JSONP data when the site loads. But I have other functions and jQuery plugins that need to ...

What's the pattern for a JSONP method that was initiated from a jQuery plugin?

I'm writing a jQuery plugin to render data retrieved from another domain in an element on the page. I follow the typical pattern for my jQuery plugin: $(selector).Plugin(options); In the plugin I get external data using jQuery.getScript(url, [success]). The external data source allows me to define the name of a method and it will wrap...

JSON / JSONP in JQuery

Hello. I am trying to figure out why my $.getJSON method does not seem to be working but the $.ajax works just fine. First, here is my getJSON call: $.getJSON("http://localhost:1505/getServiceImageList?callback=loadImagesInSelect", loadImagesInSelect); You can see I have tried added the callback parameter directly to the query strin...

Using jQuery.getJSON in Chrome Extension

I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I'd rather stick to just jQuery idioms (so my javascript can also work as a <script src="">). I do the normal: $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?",...

Insert an ajaxified Webpart into an existing MOSS site

Hi everybody, I need to code a webpart which purpose is to asynchronously fetch some documents and display them into an existing page. Unfortunately I have to face a lot of rescritcions and my struggle to find a solution seems useleess so far. 1) I cannot use Microsoft asp.net ajax 2) I must use Jsonp because the called service (page, w...

Do I need jsonp?

Since firefox 3, cross domain XmlHttpRequest is available. As my understand, jsonp is also doing something about cross domain. If I only need to deal with firefox 3, do I still need to use jsonp? ...

ajax response byte size

I'm using jQuery's getJSONP and I want to log the duration of the call and the size of the response to be able to have some statistics about the usage of my application. This is a cross domain ajax call, so I need to use JSONP, but as the JSONP call is not done with an XMLHttpRequest object, the complete callback from jquery's ajax does...