Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Configure JSONP proxy with a strategy object

#99

Extend SceneJS JSONP proxy configuration to set both how the request URL is generated and how the string data to be parsed is extracted from the response.

A new SceneJS.setJSONPProxy method configures SceneJS with a strategy to allow it to use a particular Web service to proxy cross-domain requests by SceneJS.Instance nodes when their URIs are not in the local domain. As shown in the example below, the strategy must implement two methods, one to create the request URL and another to extract a string of data from the response.

Example strategy- specifying a JSONP handler for the Yahoo! Query Language (YQL) API:

SceneJS.setJSONPStrategy({

 request : function(url, format, callback) {
       return "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20" + format + "%20where%20url='"
                        + url + "'&format=" + format + "&callback=" + callback;
 },

 response : function(data) {
       return data.results[0];
 }



});

Reported by lindsay.kay (at xeolabs) · May 30th, 2010 @ 08:14 AM

State: resolved
Milestone: V0.7.6

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.