<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Event handling in JavaScript &#8211; an alternative addEvent solution</title>
	<atom:link href="http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/</link>
	<description>Web development and Internet trends</description>
	<lastBuildDate>Fri, 12 Mar 2010 13:05:59 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: [Javascript] propriet? OnMouseOver/OnMouseOut - AlterVista Forum</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-254394</link>
		<dc:creator>[Javascript] propriet? OnMouseOver/OnMouseOut - AlterVista Forum</dc:creator>
		<pubDate>Mon, 21 Apr 2008 18:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-254394</guid>
		<description>[...] preso da http://www.robertnyman.com/2006/08/3...vent-solution/    __________________  [...]</description>
		<content:encoded><![CDATA[<p>[...] preso da <a href="http://www.robertnyman.com/2006/08/3...vent-solution/" rel="nofollow">http://www.robertnyman.com/2006/08/3&#8230;vent-solution/</a>    __________________  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-159057</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 10 Dec 2007 09:43:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-159057</guid>
		<description>Dan,

No problem. :-)</description>
		<content:encoded><![CDATA[<p>Dan,</p>
<p>No problem. <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157890</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Sat, 08 Dec 2007 11:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157890</guid>
		<description>Hmm there was someone that had posted before me asking how to create events in firefox, that&#039;s why I have posted that. But I guess it got deleted.

Sorry for the mix up.</description>
		<content:encoded><![CDATA[<p>Hmm there was someone that had posted before me asking how to create events in firefox, that&#8217;s why I have posted that. But I guess it got deleted.</p>
<p>Sorry for the mix up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157513</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 07 Dec 2007 19:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157513</guid>
		<description>Dan,

Yes, it&#039;s mentioned in the post. The problem lies with IE and its own event handling, and how to get around that.</description>
		<content:encoded><![CDATA[<p>Dan,</p>
<p>Yes, it&#8217;s mentioned in the post. The problem lies with IE and its own event handling, and how to get around that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157332</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 07 Dec 2007 11:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-157332</guid>
		<description>For Firefox you can use this:
object.addEventListener(string type, EventListener listener, boolean useCapture);

type: The Event type, without the &quot;on&quot;. Example: &#039;click&#039;
listener: The function that will handle the event.
useCapture: I&#039;m not sure what this is, but according to w3 is states that if the user wishes to initiate capture.

Example:
&lt;code&gt;
&lt;input type=&quot;button&quot; id=&quot;btnTest&quot; value=&quot;Click Me&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	document.getElementById(&#039;btnTest&#039;).addEventListener(&#039;click&#039;, btnTest_Clicked, false);
	document.getElementById(&#039;btnTest&#039;).attachEvent(&#039;onclick&#039;, btnTest_Clicked);
	addEvent(document.getElementById(&#039;btnTest&#039;), &#039;click&#039;, btnTest_Clicked);
	
	function btnTest_Clicked(evt)
	{
		evt.target.value = &#039;You Have Clicked ME!!&#039;;
	}
&lt;/script&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>For Firefox you can use this:<br />
object.addEventListener(string type, EventListener listener, boolean useCapture);</p>
<p>type: The Event type, without the &#8220;on&#8221;. Example: &#8216;click&#8217;<br />
listener: The function that will handle the event.<br />
useCapture: I&#8217;m not sure what this is, but according to w3 is states that if the user wishes to initiate capture.</p>
<p>Example:<br />
<code><br />
&lt;input type="button" id="btnTest" value="Click Me" /&gt;<br />
&lt;script type="text/javascript"&gt;<br />
	document.getElementById('btnTest').addEventListener('click', btnTest_Clicked, false);<br />
	document.getElementById('btnTest').attachEvent('onclick', btnTest_Clicked);<br />
	addEvent(document.getElementById('btnTest'), 'click', btnTest_Clicked);</p>
<p>	function btnTest_Clicked(evt)<br />
	{<br />
		evt.target.value = 'You Have Clicked ME!!';<br />
	}<br />
&lt;/script&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-55425</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 02 May 2007 06:52:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-55425</guid>
		<description>venkat,

To my knowledge, when the &lt;code&gt;onunload&lt;/code&gt; event occurs, it&#039;s not possible to tell if the window has actually been closed or just reloaded.</description>
		<content:encoded><![CDATA[<p>venkat,</p>
<p>To my knowledge, when the <code>onunload</code> event occurs, it&#8217;s not possible to tell if the window has actually been closed or just reloaded.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: venkat</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-55174</link>
		<dc:creator>venkat</dc:creator>
		<pubDate>Tue, 01 May 2007 09:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-55174</guid>
		<description>hi,
  i have a query relating to javascript attatchevent method   i  need to call a function when i close the window
  so for that the code i used
 maxWin.attachEvent(&quot;onunload&quot;, resetImageContent);
 here maxWin is an variable and resetImageContent is 
 a method 
 my requirement is i have a maximize button when i select a
 document such as text,pdf etc and press maximize button the
 document should appear in a new window, when i close the
 new window the resetImageContent method should execute
 the issue is 
 when i select MSExcel/MSword document iam enable to run
 resetImageContent method 
 those who will provide sufficient answer will be greatly   appriciated.</description>
		<content:encoded><![CDATA[<p>hi,<br />
  i have a query relating to javascript attatchevent method   i  need to call a function when i close the window<br />
  so for that the code i used<br />
 maxWin.attachEvent(&#8220;onunload&#8221;, resetImageContent);<br />
 here maxWin is an variable and resetImageContent is<br />
 a method<br />
 my requirement is i have a maximize button when i select a<br />
 document such as text,pdf etc and press maximize button the<br />
 document should appear in a new window, when i close the<br />
 new window the resetImageContent method should execute<br />
 the issue is<br />
 when i select MSExcel/MSword document iam enable to run<br />
 resetImageContent method<br />
 those who will provide sufficient answer will be greatly   appriciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-12971</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 20 Oct 2006 11:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-12971</guid>
		<description>Diego,

Interesting. You&#039;re absolutley right. I never work in environments with frames so it didn&#039;t occurr to me.</description>
		<content:encoded><![CDATA[<p>Diego,</p>
<p>Interesting. You&#8217;re absolutley right. I never work in environments with frames so it didn&#8217;t occurr to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Perini</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-12969</link>
		<dc:creator>Diego Perini</dc:creator>
		<pubDate>Fri, 20 Oct 2006 10:40:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-12969</guid>
		<description>Robert,
like in other addEvent() scripts out there, there is an inconsistency that must be corrected to be able to make it work in a multi-window/multi-frame environment. The line that must be changed in Aaron Moore code is:

&lt;code&gt;&lt;strong&gt;event = event &#124; window.event;&lt;/strong&gt;&lt;/code&gt;

this assumes you only have one window and will only work if one attaches events to the same window containing the script. If one needs to attach events to other dynamically created windows or iframes that will not work.

I believe that something like this will work in Aaron Moore code:

&lt;code&gt;&lt;strong&gt;event = event &#124;&#124; (((this.ownerDocument &#124;&#124; this.document &#124;&#124; this).parentWindow &#124;&#124; window).event);&lt;/strong&gt;&lt;/code&gt;

Also, see the latest Dean Edwards addEvent() source to see how this line has been modified to fit his code.

Diego</description>
		<content:encoded><![CDATA[<p>Robert,<br />
like in other addEvent() scripts out there, there is an inconsistency that must be corrected to be able to make it work in a multi-window/multi-frame environment. The line that must be changed in Aaron Moore code is:</p>
<p><code><strong>event = event | window.event;</strong></code></p>
<p>this assumes you only have one window and will only work if one attaches events to the same window containing the script. If one needs to attach events to other dynamically created windows or iframes that will not work.</p>
<p>I believe that something like this will work in Aaron Moore code:</p>
<p><code><strong>event = event || (((this.ownerDocument || this.document || this).parentWindow || window).event);</strong></code></p>
<p>Also, see the latest Dean Edwards addEvent() source to see how this line has been modified to fit his code.</p>
<p>Diego</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7973</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 31 Aug 2006 09:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7973</guid>
		<description>FlorentG,

I&#039;ve seen it, and to be honest I haven&#039;t read all of the code for it. However, I don&#039;t want to be dependable on Yahoo&#039;s JavaScript libraries, I&#039;m just looking for the most light-weight and easiest &lt;code&gt;addEvent&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>FlorentG,</p>
<p>I&#8217;ve seen it, and to be honest I haven&#8217;t read all of the code for it. However, I don&#8217;t want to be dependable on Yahoo&#8217;s JavaScript libraries, I&#8217;m just looking for the most light-weight and easiest <code>addEvent</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FlorentG</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7971</link>
		<dc:creator>FlorentG</dc:creator>
		<pubDate>Thu, 31 Aug 2006 09:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7971</guid>
		<description>You may use Yahoo&#039;s excellent &lt;a href=&quot;http://developer.yahoo.com/yui/event/&quot; rel=&quot;nofollow&quot;&gt;Event utility&lt;/a&gt;

See Dustin Diaz&#039;s &lt;a href=&quot;http://www.dustindiaz.com/yahoo-event-utility/&quot; rel=&quot;nofollow&quot;&gt;Review&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>You may use Yahoo&#8217;s excellent <a href="http://developer.yahoo.com/yui/event/" rel="nofollow">Event utility</a></p>
<p>See Dustin Diaz&#8217;s <a href="http://www.dustindiaz.com/yahoo-event-utility/" rel="nofollow">Review</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7965</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 31 Aug 2006 08:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7965</guid>
		<description>Tom,

As far as I know, Gecko-based web browsers have supported capturing for a long time too.

But I agree with you. If you want to handle events consistently across web browsers, playing around with capturing isn&#039;t that interesting.

Aaron,

Good luck! :-)</description>
		<content:encoded><![CDATA[<p>Tom,</p>
<p>As far as I know, Gecko-based web browsers have supported capturing for a long time too.</p>
<p>But I agree with you. If you want to handle events consistently across web browsers, playing around with capturing isn&#8217;t that interesting.</p>
<p>Aaron,</p>
<p>Good luck! <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron M.</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7942</link>
		<dc:creator>Aaron M.</dc:creator>
		<pubDate>Wed, 30 Aug 2006 23:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7942</guid>
		<description>Hi, fellow javascript developers. If you wish to help with this project, I would be most grateful. Let me tell you what I&#039;m most interested in.

Essentially, what I want boils down to 3 things: your opinion of the design itself, testing of browsers I can&#039;t test, and testing of performance.

&lt;strong&gt;1) Opinions&lt;/strong&gt;

I haven&#039;t managed to get a single javascript developer to read through the code and give me an opinion of the design. Is this method as wonderful as I think it is? The &lt;a href=&quot;http://barney.gonzaga.edu/~amoore1/php/addEvent/&quot; rel=&quot;nofollow&quot;&gt;quick explanation&lt;/a&gt; should be enough to make the code accessible. It is documented. The &lt;a href=&quot;http://barney.gonzaga.edu/~amoore1/php/addEvent/explanation.php&quot; rel=&quot;nofollow&quot;&gt;long explanation&lt;/a&gt; is comprehensive. Reading it should leave you with no questions.

&lt;strong&gt;2) Browsers&lt;/strong&gt;

I don&#039;t have easy access to a Mac. I believe that my functions will work on IE 5.5 on Mac, but I haven&#039;t been able to test it yet. Any old browsers, or rare browsers which support javascript would be appreciated. If the table on the testing page does not already have an entry for a browser you have, I probably can&#039;t test it. This is important to me because I want them to support &lt;b&gt;all&lt;/b&gt; browsers that a person might want to do DHTML programming in.

&lt;strong&gt;3) Performance&lt;/strong&gt;

After the addEvent contest on Quirksmode, some performance issues, such as &#039;memory leaks,&#039; were brought up. I don&#039;t have experience testing performance in javascript, but since I mean these functions to be as good as possible, I want them to be efficient in time and memory. If you have experience doing this kind of testing, I would love to hear from you.

Please, email me (two.a.ron [at] gmail [dot] com), or post comments on the &lt;a href=&quot;http://barney.gonzaga.edu/~amoore1/php/addEvent/explanation.php#bottom&quot; rel=&quot;nofollow&quot;&gt;explanation page&lt;/a&gt;.

Thanks again,

 --Aaron</description>
		<content:encoded><![CDATA[<p>Hi, fellow javascript developers. If you wish to help with this project, I would be most grateful. Let me tell you what I&#8217;m most interested in.</p>
<p>Essentially, what I want boils down to 3 things: your opinion of the design itself, testing of browsers I can&#8217;t test, and testing of performance.</p>
<p><strong>1) Opinions</strong></p>
<p>I haven&#8217;t managed to get a single javascript developer to read through the code and give me an opinion of the design. Is this method as wonderful as I think it is? The <a href="http://barney.gonzaga.edu/~amoore1/php/addEvent/" rel="nofollow">quick explanation</a> should be enough to make the code accessible. It is documented. The <a href="http://barney.gonzaga.edu/~amoore1/php/addEvent/explanation.php" rel="nofollow">long explanation</a> is comprehensive. Reading it should leave you with no questions.</p>
<p><strong>2) Browsers</strong></p>
<p>I don&#8217;t have easy access to a Mac. I believe that my functions will work on IE 5.5 on Mac, but I haven&#8217;t been able to test it yet. Any old browsers, or rare browsers which support javascript would be appreciated. If the table on the testing page does not already have an entry for a browser you have, I probably can&#8217;t test it. This is important to me because I want them to support <b>all</b> browsers that a person might want to do DHTML programming in.</p>
<p><strong>3) Performance</strong></p>
<p>After the addEvent contest on Quirksmode, some performance issues, such as &#8216;memory leaks,&#8217; were brought up. I don&#8217;t have experience testing performance in javascript, but since I mean these functions to be as good as possible, I want them to be efficient in time and memory. If you have experience doing this kind of testing, I would love to hear from you.</p>
<p>Please, email me (two.a.ron [at] gmail [dot] com), or post comments on the <a href="http://barney.gonzaga.edu/~amoore1/php/addEvent/explanation.php#bottom" rel="nofollow">explanation page</a>.</p>
<p>Thanks again,</p>
<p> &#8211;Aaron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom W.M.</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7938</link>
		<dc:creator>Tom W.M.</dc:creator>
		<pubDate>Wed, 30 Aug 2006 22:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7938</guid>
		<description>Honestly, why does support for capturing matter?  So far as I know, Opera is the only modern browser that supports it.  A big problem with the original &lt;code&gt;addEvent&lt;/code&gt; (so far as there &lt;em&gt;is&lt;/em&gt; an original) was that it included the capturing argument as a passthrough to the third argument of &lt;code&gt;addEventListener&lt;/code&gt;--many people set it to true, and this resulted in inconsistencies between Firefox (which will pretend that capturing is false) and Opera caused confusion.  And, of course, Internet Explorer doesn&#039;t even pretend to support capturing.  Because of all of this, I can&#039;t see how capturing support &lt;em&gt;can&lt;/em&gt; be included in a general event-handling solution.  If you need capturing--and I can&#039;t think of why you would (any ideas?)--you should deal with cross-browser inconsistencies yourself.  They&#039;re impossible to abstract.</description>
		<content:encoded><![CDATA[<p>Honestly, why does support for capturing matter?  So far as I know, Opera is the only modern browser that supports it.  A big problem with the original <code>addEvent</code> (so far as there <em>is</em> an original) was that it included the capturing argument as a passthrough to the third argument of <code>addEventListener</code>&#8211;many people set it to true, and this resulted in inconsistencies between Firefox (which will pretend that capturing is false) and Opera caused confusion.  And, of course, Internet Explorer doesn&#8217;t even pretend to support capturing.  Because of all of this, I can&#8217;t see how capturing support <em>can</em> be included in a general event-handling solution.  If you need capturing&#8211;and I can&#8217;t think of why you would (any ideas?)&#8211;you should deal with cross-browser inconsistencies yourself.  They&#8217;re impossible to abstract.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7914</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 30 Aug 2006 14:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7914</guid>
		<description>medyk,

While I understand your position, what you&#039;re missing out on by using inline event handlers is, most likely, accessibility (it depends on what element you&#039;re applying the event to) and also that the user will have to load a lot of extra kilobytes for all those extra event handlers, as opposed to having all the events in a JavaScript file that will be cached by the web browser after the first visit to your page; i.e. unnecessary extra bandwidth usage.

Something that might address your concerns and apply JavaScript events as soon as possible to a web page is by not using the &lt;code&gt;window.onload&lt;/code&gt; event, but instead by using the approach suggested by Dean Edwards: &lt;a href=&quot;http://dean.edwards.name/weblog/2005/09/busted/&quot; rel=&quot;nofollow&quot;&gt;The window.onload Problem - Solved!&lt;/a&gt; and &lt;a href=&quot;http://dean.edwards.name/weblog/2006/06/again/&quot; rel=&quot;nofollow&quot;&gt;window.onload (again)&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>medyk,</p>
<p>While I understand your position, what you&#8217;re missing out on by using inline event handlers is, most likely, accessibility (it depends on what element you&#8217;re applying the event to) and also that the user will have to load a lot of extra kilobytes for all those extra event handlers, as opposed to having all the events in a JavaScript file that will be cached by the web browser after the first visit to your page; i.e. unnecessary extra bandwidth usage.</p>
<p>Something that might address your concerns and apply JavaScript events as soon as possible to a web page is by not using the <code>window.onload</code> event, but instead by using the approach suggested by Dean Edwards: <a href="http://dean.edwards.name/weblog/2005/09/busted/" rel="nofollow">The window.onload Problem &#8211; Solved!</a> and <a href="http://dean.edwards.name/weblog/2006/06/again/" rel="nofollow">window.onload (again)</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: medyk</title>
		<link>http://robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7895</link>
		<dc:creator>medyk</dc:creator>
		<pubDate>Wed, 30 Aug 2006 11:03:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2006/08/30/event-handling-in-javascript-an-alternative-addevent-solution/#comment-7895</guid>
		<description>There&#039;s one advantage of using inline event handlers.. is that they&#039;re avaliable right when element appeared in DOM tree.
Going other way you can assign event after all page is loaded or you need to use other combined way to get it faster.. 
It might be issue with large pages (that has content loaded partially).
So sometimes I use inline event handlers as it&#039;s simplier (I don&#039;t need to search for elements with javascript later) and quite rarely I&#039;m assigning two different methods to one event,</description>
		<content:encoded><![CDATA[<p>There&#8217;s one advantage of using inline event handlers.. is that they&#8217;re avaliable right when element appeared in DOM tree.<br />
Going other way you can assign event after all page is loaded or you need to use other combined way to get it faster..<br />
It might be issue with large pages (that has content loaded partially).<br />
So sometimes I use inline event handlers as it&#8217;s simplier (I don&#8217;t need to search for elements with javascript later) and quite rarely I&#8217;m assigning two different methods to one event,</p>
]]></content:encoded>
	</item>
</channel>
</rss>
