• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    This module has been deprecated and is no longer supported by the module author.

    JSONP (gallery-jsonp) on cdn

    Last Updated: 10/22/10

    Luke Smith

    YUI Contributor

    See 19 more by this user.

    Featured Item

    Created: 10/24/09
    Last CDN Push: 08/11/10
    Build Tag: gallery-2010.08.11-20-39
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.2.0
    Free for use.

    Deprecated. Use the official 'jsonp' module.

    Provides a JSONPRequest class for repeated JSONP calls, and a convenience method Y.jsonp(url, callback) to instantiate and send a JSONP request.

    The callback for the response can be named in the url explicitly or provided in the configuration (second parameter to the constructor).

    By default, the query parameter string &quot;callback=???&quot; will be searched for in the url (??? can be anything). If it's not found, it will be added on. If the JSONP service uses a different parameter name or url format, you can override this behavior with the <code>format</code> property in the callback config.

    The second parameter can be a callback function that accepts the JSON payload as its argument, or a configuration object supporting the keys:

    * on - map of callback subscribers
    * success - function handler for successful transmission
    * failure - function handler for failed transmission
    * timeout - function handler for transactions that timeout
    * format - override function for inserting the proxy name in the url
    * timeout - the number of milliseconds to wait before giving up
    * context - becomes <code>this</code> in the callbacks
    * args - array of subsequent parameters to pass to the callbacks

    • Tags:
    • lsmith
    • jsonp
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Code Sample

    <script src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2010.08.11-20-39'
    }).use('gallery-jsonp', function(Y) {
     
        var url = "http://query.yahooapis.com/v1/public/yql?" +
                      "q=select%20*%20from%20upcoming.events%20" +
                      "where%20woeid%20in%20" + 
                      "(select%20woeid%20from%20geo.places%20" +
                      "where%20text%3D%22North%20Beach%22)" +
                      "&format=json&diagnostics=false";
     
        var upcoming = Y.one('#upcoming');
     
        Y.jsonp(url, function (data) {
            Y.each(data.query.results.event, function (o) {
                upcoming.append("<h3>" + o.name + "</h3><p>" + o.description + "</p>");
            });
        });
     
    });

    Forum Posts

    Subject Author Date
    Calling jsonp more than once on a page fails jrussbowman 01/9/10
    Re: Calling jsonp more than once on a page fails Luke Smith 02/8/10
    JSONP and Yahoo! Pipes Itye Richter 04/28/10
    Re: JSONP and Yahoo! Pipes Itye Richter 04/28/10

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info