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

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

animation greghinch plugin solmsted widget css caridy lsmith yql form async node liferay datatable satyam model ericf jafl event davglass nzakas apipkin table io foxxtrot

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.

    IO Poller (gallery-io-poller) on cdn

    Last Updated: 12/31/09
    + 6 -

    Eric Ferraiuolo

    YUI Developer

    See 9 more by this user.

    Created: 10/29/09
    Last CDN Push: 11/19/09
    Build Tag: gallery-2009.11.19-20
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.0.0
    Free for use.

    Use just like regular Y.io, but the first parameter is the number of milliseconds to continually xhr-poll at. A new callback method/event has been added, 'modified', which will only be called when the server resource sends a 200 OK response.

    The IO config object (third parameter to Y.io.poll) is just like, Y.io's config object; but a new on: { modified: function(txId, r, args){ /* your callback code here */ } } callback/event is added.

    This will smartly poll the server using conditional GET requests (when method is set to GET).

    Blog post on smart polling: http://925html.com/code/smart-polling/

    • Tags:
    • ericf
    • io
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Code Sample

    <script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2009.11.19-20'
    }).use('gallery-io-poller', function(Y) {
     
    	var resource = Y.io.poll(5000, 'path/to/resource/', {
    		on : {
    			modified : function (txId, r, args) {
     
    				// the resource has been modified
     
    			}
    		}
    	});
    	resource.start();
     
    });

    Forum Posts

    Subject Author Date
    Awesome utility! Jacob Fogg 03/24/10
    Re: Awesome utility! Eric Ferraiuolo 03/25/10
    IE treats the server response as 304 Colin Yates 11/10/11
    Re: IE treats the server response as 304 Colin Yates 11/10/11
    Why are ioConfig and uri writeonce attributes? Iliyan Peychev 05/5/12

    © 2006-2011 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