Dispatcher Information
The Dispatcher plugin was created to satisfy 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 plugin avoids those problems.
This component do not required the Bubbling Core Object, only YUI Core, YUI Connection Manager, YUI Dom and YUI Event. And it guarantees these three points::
- All of the dynamic contents (loaded thru the YUI Connection Manager) will be processed by the Dispatcher, and the javascript chunks will be executed (remote and inline scripts)
- All the javascripts within a content will be executed according to the order of apparition.
- All the contents will be included in the DOM's structure before beginning the execution process. This means that you can use references to an element within the container.
The last release of the dispatcher support cross-domains capabilities using the most common technique (proxy), also introduce two new method "jsLoader" and "cssLoader", for remote script and CSS loading onDemand and the hashtable to discard multiple execution for the same remote file, and path-correction for remote files if you need it.
Minor grammar and word use comments
On the page , I noticed a couple simple grammar and word use problems that you might want to know about.
First, the two sentences starting with "The Dispatcher plugin ..." are very hard to digest.
The following is an attempt to rewrite this in a form I can understand (but I may be missing something you're trying tto impart):
The Dispatcher plugin was created to satisfy 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 plugin avoids those problems.
Second, the phrase "... order of apparition" should probably be "... order of appearance". If you look up "apparition" in the dictionary, you'll see that's not quite the right word.
Where to post specific questions
Halo all,
Which type of CMS library specific questions do we post here or should they all go through the YUI group?
RE: Where to post specific questions
Hey George,
You can post in the YUI Group, or just email me directly.
Is this now compatible with YUI 2.6.0?
Have you tested this with the new YUI 2.6.0? Is it compatible?
RE: Is this now compatible with YUI 2.6.0?
Hey Cody, the dispatcher 1.5 can work on top of YUI 2.6.0 without any problem. In fact if you check this website, you will see that the bubbling library 1.5 is working on top of 2.6.0.
Anyway, if you have any problem, just let me know.
Dispatcher and Layout Manager
I've read elsewhere - on the Yahoo groups I think - that Dispatcher should also work with Layout Manger. I know you don't have any of the specific pre-built stuff finished yet, but it is possible to use it and if so, could you send me a small example?
Thanks
Re: Dispatcher and Layout Manager
Hey Dennins:
You're right, in the YUI 2.6.0 I wrote the routines for AJAX within the layout manager (the same routines that we use in the tabview). The dispatcher can extend this functionality to execute the scripts.
Unfortunately this new functionality is not documented yet in the YUI 2.6.0, and also the Bubbling 1.5 don't support it yet.
But here is an example running on top of YUI 2.6.0 and Bubbling Library 2.0 beta.
http://bubbling-library.com/sandbox/yui2/dispatcher/layout.html
If you want more information, send me an email.
dispatcher and uploader plugin together
Hi,
I posted this message at YUI Group too.
I try to use dispatcher and uploader plugin together.
I use html file with javascript inside as it is described in 'Advanced Uploader Example With Additional POST Variables and Server Data Return' for Ajax call.
When I try to upload I get 'uploader is not defined'.
Are these two plugins compatible to each other?
any help, please?
Thanks
RE: dispatcher and uploader plugin together
Hey Gia, I don't see how the dispatcher can affect the uploader utility. Do you have a test case of something where I can dig a little bit?
Also, the only way I see we can use it together is to using distpacher.process to process the response from the uploader. Is that the way you want to use it?
fail to excute a js in ie with yui version 2.7.0
Hi, i have try the dispatcher with yui version 2.7.0 in ie. And found that, if the js in reponse is calling a js function already in current page. then the js with not be excuted. any ideas?
fail to excute a js in ie with yui version 2.7.0
but it works in firefox
fail to excute a js in ie with yui version 2.7.0
i mean, the inline js in response is executed, but not the remote one.
Thanks
RE: fail to excute a js in ie with yui version 2.7.0
Hello Allen,
Are you using the dispatcher latest version? If that's the case, try to verify the path, probably you will have to use path-correction option in dispatcher, or verify that all the requirements to execute that file are in place. And finally, you can try to include the external file as part of the original content just to double check that it works in IE.
Also, you should check the inline block, it if fails, then dispatcher will abort the execution process and probably the remote file will never be executed.
Best Regards,
Caridy