<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: AjaxEvent: Using YUI custom events with Ajax</title>
	<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax</link>
	<description>JADE and JAVA</description>
	<pubDate>Mon, 06 Sep 2010 20:06:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Marco</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-216</link>
		<dc:creator>Marco</dc:creator>
		<pubDate>Wed, 08 Jul 2009 01:07:06 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-216</guid>
		<description>&lt;p&gt;Very nice article and code example!&lt;/p&gt;
&lt;p&gt;I was wondering whether this whole idea can’t be taken to an even higher level by creating some sort of singleton which holds all of these AJAX events + connections. Like this it might even be possible to recycle eval-ed JSON responses in cases where it’s unlikely that the server response changes between requests to the exact same URL (for example gimmesomejson.php?skeleton=24) if we’d store the response. This could possibly speed up the application and reduce server load.&lt;/p&gt;
&lt;p&gt;Not sure if this makes sense, it’s saturday morning after all, but maybe it’s worth looking into? &lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Very nice article and code example!</p>
<p>I was wondering whether this whole idea can’t be taken to an even higher level by creating some sort of singleton which holds all of these AJAX events + connections. Like this it might even be possible to recycle eval-ed JSON responses in cases where it’s unlikely that the server response changes between requests to the exact same URL (for example gimmesomejson.php?skeleton=24) if we’d store the response. This could possibly speed up the application and reduce server load.</p>
<p>Not sure if this makes sense, it’s saturday morning after all, but maybe it’s worth looking into? </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-215</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 07 Jul 2009 07:07:26 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-215</guid>
		<description>&lt;p&gt;@ Marco: When we first started developing this idea, we originally created AjaxEvent as a singleton. However, it soon became apparent that it needed to be instantiable to maintain several of the properties when handling multiple requests.&lt;/p&gt;
&lt;p&gt;I’m not sure that wrapping these instantiated objects inside another singleton would be such a good idea — there are many benefits to be had by allowing those instantiations to be inherited by other objects elsewhere.&lt;/p&gt;
&lt;p&gt;As far as recycling eval’d JSON responses is concerned, there’s really no reason why we couldn’t check it against the response within the AjaxEvent object itself. It’s a nice idea and one I shall look into.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@ Marco: When we first started developing this idea, we originally created AjaxEvent as a singleton. However, it soon became apparent that it needed to be instantiable to maintain several of the properties when handling multiple requests.</p>
<p>I’m not sure that wrapping these instantiated objects inside another singleton would be such a good idea — there are many benefits to be had by allowing those instantiations to be inherited by other objects elsewhere.</p>
<p>As far as recycling eval’d JSON responses is concerned, there’s really no reason why we couldn’t check it against the response within the AjaxEvent object itself. It’s a nice idea and one I shall look into.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Manno</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-214</link>
		<dc:creator>Frank Manno</dc:creator>
		<pubDate>Tue, 07 Jul 2009 03:07:04 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-214</guid>
		<description>&lt;p&gt;Tim,&lt;/p&gt;
&lt;p&gt;Nice script!  I think the example greatly demonstrates the usefulness of this type of event system.&lt;/p&gt;
&lt;p&gt;One thing regarding the “subscribe” function.  In the YAHOO.util.CustomEvent constructor, you pass “ajaxevent” as the first parameter.  Does this mean anything in terms of the application, or is it simply an identifier?&lt;/p&gt;
&lt;p&gt;I’m just curious as to whether you would need custom “AjaxEvent” objects that use different event names?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Nice script!  I think the example greatly demonstrates the usefulness of this type of event system.</p>
<p>One thing regarding the “subscribe” function.  In the YAHOO.util.CustomEvent constructor, you pass “ajaxevent” as the first parameter.  Does this mean anything in terms of the application, or is it simply an identifier?</p>
<p>I’m just curious as to whether you would need custom “AjaxEvent” objects that use different event names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-213</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 06 Jul 2009 01:07:38 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-213</guid>
		<description>&lt;p&gt;@ Frank: The “ajaxevent” that is passed as the first parameter into the YUI YAHOO.util.CustomEvent constructor is, as you suspect, simply an identifier for the CustomEvent. This string is returned to listeners that receive this event so that they know what event occurred.&lt;/p&gt;
&lt;p&gt;I’m not sure you’d need different event names per AjaxEvent object since they will all be of the type “ajaxevent” — it simply identifies the type of event. Of course, there’s no reason why they couldn’t be nested inside other CustomEvents though; for instance, we’ve recently been using them inside a “tabactivated” event inside a tab module.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@ Frank: The “ajaxevent” that is passed as the first parameter into the YUI YAHOO.util.CustomEvent constructor is, as you suspect, simply an identifier for the CustomEvent. This string is returned to listeners that receive this event so that they know what event occurred.</p>
<p>I’m not sure you’d need different event names per AjaxEvent object since they will all be of the type “ajaxevent” — it simply identifies the type of event. Of course, there’s no reason why they couldn’t be nested inside other CustomEvents though; for instance, we’ve recently been using them inside a “tabactivated” event inside a tab module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Fitch</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-211</link>
		<dc:creator>David Fitch</dc:creator>
		<pubDate>Sun, 05 Jul 2009 12:07:33 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-211</guid>
		<description>&lt;p&gt;This is great, thanks for your contribution!&lt;/p&gt;
&lt;p&gt;I’m what I consider to be a novice with javascript, and OOP in general, so I was having a LOT of trouble figuring out how to fire two separate requests intended to populate two separate divs, using one event. I stumbled across this, and voila! I modified the connect method slightly to allow for passing of ‘targetDiv’, so I can trigger both of the following onLoad:&lt;/p&gt;
&lt;p&gt;myAjaxEvent.connect(’groups-test.asp?action=add’,'divDataDisplay’);
myAjaxEvent.connect(’groups-edit-test.asp’,'divDataAddEdit’);  &lt;/p&gt;
&lt;p&gt;And then replaced the JSON stuff with a simple getElementById(targetDiv).innerHTML = o.responseText&lt;/p&gt;
&lt;p&gt;Thanks again!!!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is great, thanks for your contribution!</p>
<p>I’m what I consider to be a novice with javascript, and OOP in general, so I was having a LOT of trouble figuring out how to fire two separate requests intended to populate two separate divs, using one event. I stumbled across this, and voila! I modified the connect method slightly to allow for passing of ‘targetDiv’, so I can trigger both of the following onLoad:</p>
<p>myAjaxEvent.connect(’groups-test.asp?action=add’,&#8217;divDataDisplay’);<br />
myAjaxEvent.connect(’groups-edit-test.asp’,&#8217;divDataAddEdit’);  </p>
<p>And then replaced the JSON stuff with a simple getElementById(targetDiv).innerHTML = o.responseText</p>
<p>Thanks again!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Manno</title>
		<link>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-212</link>
		<dc:creator>Frank Manno</dc:creator>
		<pubDate>Sun, 05 Jul 2009 10:07:39 +0000</pubDate>
		<guid>http://www.teschet.net/ajaxevent-using-yui-custom-events-with-ajax#comment-212</guid>
		<description>&lt;p&gt;Tim,&lt;/p&gt;
&lt;p&gt;Thanks for clearing that up.  I thought that’s what it was… I should have checked the YUI APIs before posting  &lt;/p&gt;
&lt;p&gt;Care to share more about the nested CustomEvents?  It sounds interesting…&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>Thanks for clearing that up.  I thought that’s what it was… I should have checked the YUI APIs before posting  </p>
<p>Care to share more about the nested CustomEvents?  It sounds interesting…</p>
]]></content:encoded>
	</item>
</channel>
</rss>
