YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUI Compressor
  • YUI Doc
  • 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

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

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.

    Dispatcher (gallery-dispatcher) on cdn

    Last Updated: 05/17/10
    + 1 -

    Caridy Patino

    YUI Contributor

    See 6 more by this user.

    Created: 11/26/09
    Last CDN Push: 05/21/10
    Build Tag: gallery-2010.05.21-18-16
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.1.1
    Free for use.

    The Dispatcher satisfies a very common need of developers using the YUI library: dynamic execution of Ajax response content. Typical strategies to fulfill this need, like executing the innerHTML property or referencing remote scripts, are unreliable due to browser incompatibilities. The Dispatcher normalize this behavior across all a-grade browsers.

    • Tags:
    • io
    • javascript
    • caridy
    • dispatcher
    • bubbling
    • ajax
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Very simple example to inject two HTML fragments, one of then setting the content directly, and the other one using io. In both cases the content will be injected into a node (selector: #demo or #demoajax). In the process, the dispatcher will execute JS, and inject CSS into the current page.

    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-2010.05.21-18-16'
    }).use('gallery-dispatcher', function(Y) {
     
      new Y.Dispatcher ({
            node: '#demo',
            content: '<p>Please wait... (Injecting Static Markup)</p>'
      }).set('content', "<p>HTML Fragment with style, link and/or script tags (eg. <style>body{color:red;}</style>)");
     
      new Y.Dispatcher ({
            node: '#demoajax',
            content: 'Please wait... (Injecting External Markup: fragment.html)'
      }).set('uri', 'fragment.html');
     
    });

    Forum Posts

    Subject Author Date
    How to load gallery-dispatcher alexlebek 12/17/09
    Re: How to load gallery-dispatcher Caridy Patino 12/18/09
    Trouble using the dispatcher David Robert 03/5/10
    Re: Trouble using the dispatcher Caridy Patino 03/5/10
    Re: Trouble using the dispatcher David Robert 03/17/10
    Re: Trouble using the dispatcher Caridy Patino 03/18/10
    Trouble loading html fragment with script Marc 04/26/10
    Re: Trouble loading html fragment with script Caridy Patino 04/26/10
    Re: Trouble loading html fragment with script Marc 04/26/10
    Re: Trouble loading html fragment with script Caridy Patino 04/26/10
    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUI Doc
    • YUI Compressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    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