YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUI Labs
  • YUI Compressor
  • More
  • Gallery Forums
  • Gallery Stats
  • Gallery Calendar
  • Register
  • Login

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

lsmith io ajax jacobfogg event davglass plugin adam caridy yui2 form apipkin slideshow tivac jsonp node ericf port overlay rgrove jafl nzakas foxxtrot skinnable widget animation

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
    + 5 -

    Eric Ferraiuolo

    YUI Contributor

    See 6 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.1.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
    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUI Doc
    • YUI Compressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    YUI Labs
    • All YUI Labs Projects
    • Yeti
    Pages & Links
    • All YUI Downloads
    • Git FAQ
    • Graded Browser Support
    • Contribute to YUI
    • Forum Stats
    • Gallery Stats
    • YUI Calendar
    Contribute
    • Submit a Bug
    • Request a Feature
    • Write Code
    • Meet the Team
    Follow YUI
    • on GitHub
    • on Twitter
    • on FriendFeed
    • on Facebook
    • on IRC
    • YUI Blog
    • YUI Theater
    • YUI Forums

    © 2010 YUI Library - Site Credits