Forums

Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:

  • yui-support - replaces the `YUI 3.x` and `YUI 3 Gallery` forums.
    We have created the following discussion categories within this group to aid discoverability for these most-used topics:
    • Charts for YUI Charts support.
    • DataTable for YUI DataTable support.
    • Gallery for YUI Gallery support, including support for published Gallery components as well as the Gallery process in general.
    • Tools for support of YUI’s suite of developer tools such as selleck, shifter, grover, yogi, etc.
    • Everything Else for questions that don’t fit one of the categories above, we’ve got you covered here.
  • yui-deprecated - replaces the `YUI 2.x` forum and the forums of other deprecated products (`YUI Doc`, `Builder`, `YUI PHP Loader`, etc.).
  [ 2 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic

jrussbowman

  • Joined: Sat Oct 10, 2009 10:22 am
  • Posts: 7
  • Offline
  • Profile

Calling jsonp more than once on a page fails

Post Posted: Sat Jan 09, 2010 12:25 pm
+0-
I set up a simple test here - http://www.hatethegame.net/jsonp/

Basically, jsonp works if you call it once, but all calls after that do nothing, and also throw no error. From what I can see in firebug, it's not making any network requests.

Luke Smith

YUI Contributor

  • Username: lsmith
  • Joined: Thu Aug 28, 2008 7:50 am
  • Posts: 516
  • Location: Sunnyvale
  • Twitter: ls_n
  • GitHub: lsmith
  • Gists: lsmith
  • IRC: ls_n
  • YUI Developer
  • Offline
  • Profile

Re: Calling jsonp more than once on a page fails

Post Posted: Sun Feb 07, 2010 10:46 pm
+0-
What was likely happening was due to the Loader being optimized not to pull down a module twice. The previous architecture used Loader to fetch the JSONP in a new sandbox by assigning it to a static module name '_'.

I've refactored it to use the Get util (for a few reasons) and added a few niceties on while I was in there. Now it supports parsing the callback from the url string as well as context override, additional args, and a new timeout hook.

Config signature changed though. The callbacks are now inside an 'on' property to be more in accordance with the rest of the library. E.g.

Code:
Y.jsonp( url, {
    on: {
        success: someObject.doMyBidding
    },
    context: someObject,
    args: [ "these will appear", "after the JSON object", "as the 2nd, 3rd, and 4th params to doMyBidding" ]
} );
  [ 2 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum