<?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: Making Unobtrusive JavaScript Practical Again</title>
	<atom:link href="http://www.impressivewebs.com/unobtrusive-javascript-practical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/</link>
	<description>Web Design Articles &#38; Tutorials. To make the web impressive.</description>
	<lastBuildDate>Sat, 04 Feb 2012 03:12:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: qertoip</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-7954</link>
		<dc:creator>qertoip</dc:creator>
		<pubDate>Fri, 24 Dec 2010 14:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-7954</guid>
		<description>You made a great point. This is the real issue that bothers me too.

Moreover, firebug magic should never be necessary just to read and understand the code!

We need to solve the connection problem in the code. See also Jamis Buck considerations about this: http://weblog.jamisbuck.org/2010/3/2/unobtrusive-yet-explicit

Ideally, Ctrl+B on the element in your favorit IDE should take you to where the relevant events are defined.</description>
		<content:encoded><![CDATA[<p>You made a great point. This is the real issue that bothers me too.</p>
<p>Moreover, firebug magic should never be necessary just to read and understand the code!</p>
<p>We need to solve the connection problem in the code. See also Jamis Buck considerations about this: <a href="http://weblog.jamisbuck.org/2010/3/2/unobtrusive-yet-explicit" rel="nofollow">http://weblog.jamisbuck.org/2010/3/2/unobtrusive-yet-explicit</a></p>
<p>Ideally, Ctrl+B on the element in your favorit IDE should take you to where the relevant events are defined.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Lazaris</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6756</link>
		<dc:creator>Louis Lazaris</dc:creator>
		<pubDate>Wed, 01 Sep 2010 17:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6756</guid>
		<description>I agree, in most cases, it&#039;s easy to find the event based on class or id. But that is not always the case, so at times events are somewhat hidden.

I know that the solution I proposed has maintenance problems, and I pointed that out in the article. Which is why I proposed a simpler comment to be added that wouldn&#039;t require maintenance.

But I think you&#039;re wrong when you say:

&lt;blockquote&gt;You shouldn&#039;t ever need to know that. It should be transparent, irrelevant, a separate and self-contained layer, the functional layer.&quot;&lt;/blockquote&gt;

Separation of behaviour from markup is supposed to be for the purpose of maintainability. But if that separation causes maintenance problems, then it is for no purpose. I think we need to get away from the &quot;trend&quot; of separating our layers for separation&#039;s sake, and start creating code that is maintainable.

But don&#039;t get me wrong: I agree with most of what you&#039;re saying; I just think there are some circumstances where complex JS code can be a little tricky to track down, and a solution like this could help at least a little bit.</description>
		<content:encoded><![CDATA[<p>I agree, in most cases, it&#8217;s easy to find the event based on class or id. But that is not always the case, so at times events are somewhat hidden.</p>
<p>I know that the solution I proposed has maintenance problems, and I pointed that out in the article. Which is why I proposed a simpler comment to be added that wouldn&#8217;t require maintenance.</p>
<p>But I think you&#8217;re wrong when you say:</p>
<blockquote><p>You shouldn&#8217;t ever need to know that. It should be transparent, irrelevant, a separate and self-contained layer, the functional layer.&#8221;</p></blockquote>
<p>Separation of behaviour from markup is supposed to be for the purpose of maintainability. But if that separation causes maintenance problems, then it is for no purpose. I think we need to get away from the &#8220;trend&#8221; of separating our layers for separation&#8217;s sake, and start creating code that is maintainable.</p>
<p>But don&#8217;t get me wrong: I agree with most of what you&#8217;re saying; I just think there are some circumstances where complex JS code can be a little tricky to track down, and a solution like this could help at least a little bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Burgess</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6755</link>
		<dc:creator>Matt Burgess</dc:creator>
		<pubDate>Wed, 01 Sep 2010 12:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6755</guid>
		<description>I actually don&#039;t think this is the issue you think it is. I rarely have trouble finding the action occurring, even on a complex website. You can almost always find it by something bound on the selector, or occasionally on the class, etc. That is trivially easy to find.

But your &quot;solution&quot; here isn&#039;t a good one.
&lt;code&gt;
&lt;a href=&quot;#&quot; id=&quot;myLink&quot;&gt;click this link&lt;/a&gt;
&lt;!-- JS: scripts/link.js selector: myLink --&gt;
&lt;/code&gt;
The point of the way things are done now is to get the javascript references OUT of the HTML, to separate them and make them not dependent on each other. This improves manageability of BOTH the JS and the HTML. Either can be upgraded or revised without them being intertwined.

What you&#039;re doing there is the worst of both worlds. You make your html require extra maintenence (say you move the javascript) and you make it obvious that &quot;this HTML has javascript on it&quot;. That should be the opposite of the point. You shouldn&#039;t ever need to know that. It should be transparent, irrelevant, a separate and self-contained layer, the functional layer.</description>
		<content:encoded><![CDATA[<p>I actually don&#8217;t think this is the issue you think it is. I rarely have trouble finding the action occurring, even on a complex website. You can almost always find it by something bound on the selector, or occasionally on the class, etc. That is trivially easy to find.</p>
<p>But your &#8220;solution&#8221; here isn&#8217;t a good one.<br />
<code><br />
&lt;a href="#" id="myLink"&gt;click this link&lt;/a&gt;<br />
&lt;!-- JS: scripts/link.js selector: myLink --&gt;<br />
</code><br />
The point of the way things are done now is to get the javascript references OUT of the HTML, to separate them and make them not dependent on each other. This improves manageability of BOTH the JS and the HTML. Either can be upgraded or revised without them being intertwined.</p>
<p>What you&#8217;re doing there is the worst of both worlds. You make your html require extra maintenence (say you move the javascript) and you make it obvious that &#8220;this HTML has javascript on it&#8221;. That should be the opposite of the point. You shouldn&#8217;t ever need to know that. It should be transparent, irrelevant, a separate and self-contained layer, the functional layer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Rice</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6558</link>
		<dc:creator>Greg Rice</dc:creator>
		<pubDate>Tue, 17 Aug 2010 10:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6558</guid>
		<description>I&#039;m a lowly, would-be javascript code-paster, but I found a comment from a bright, young guy who is blogging his progress in code development - Corey Hart of CodeNothing.com

&quot;...all event&#039;s binded (sic) through jQuery, are actually stored in the
&#039;events&#039; portion of that elements data object.&quot;

1. maybe this precludes a need for &quot;firequery&quot;?

2. I know jQuery is just one library of javascript functions - but it sure
is prevalent and in interesting, useful projects. So maybe this could help
clarify a narrow tree-branch on tracking of bound events?

3. Or am I off the mark - does this info not indicate the ultimate HTML
affected by the javascript?

thanks for your great info!</description>
		<content:encoded><![CDATA[<p>I&#8217;m a lowly, would-be javascript code-paster, but I found a comment from a bright, young guy who is blogging his progress in code development &#8211; Corey Hart of CodeNothing.com</p>
<p>&#8220;&#8230;all event&#8217;s binded (sic) through jQuery, are actually stored in the<br />
&#8216;events&#8217; portion of that elements data object.&#8221;</p>
<p>1. maybe this precludes a need for &#8220;firequery&#8221;?</p>
<p>2. I know jQuery is just one library of javascript functions &#8211; but it sure<br />
is prevalent and in interesting, useful projects. So maybe this could help<br />
clarify a narrow tree-branch on tracking of bound events?</p>
<p>3. Or am I off the mark &#8211; does this info not indicate the ultimate HTML<br />
affected by the javascript?</p>
<p>thanks for your great info!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Domenic Denicola</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6399</link>
		<dc:creator>Domenic Denicola</dc:creator>
		<pubDate>Sat, 07 Aug 2010 20:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6399</guid>
		<description>All of my sites use jQuery, and I generally follow the practice of only attaching events inside of the main $(function () { ... }) block, i.e. the on-document-ready block. Thus I know I can just look in any script file relevant to the page, in that particular section, in order to figure out the handler location. And knowing the right script file is usually pretty easy, too: if it&#039;s a global element (appearing on all pages), it&#039;s probably in my /Scripts/Global.js; if it&#039;s specific to the page, it&#039;s probably in PageName.js.

The only exception is dynamically-added event handlers (i.e. ones that aren&#039;t always on), since it&#039;s not appropriate to wire those up inside $(function () { ... }). But in those cases, the elements are often themselves added dynamically, or if they&#039;re not, then the event-adding process is so crucial to the page that it should be obvious enough to look for a function like ProcessCalendarActions() or the like.</description>
		<content:encoded><![CDATA[<p>All of my sites use jQuery, and I generally follow the practice of only attaching events inside of the main $(function () { &#8230; }) block, i.e. the on-document-ready block. Thus I know I can just look in any script file relevant to the page, in that particular section, in order to figure out the handler location. And knowing the right script file is usually pretty easy, too: if it&#8217;s a global element (appearing on all pages), it&#8217;s probably in my /Scripts/Global.js; if it&#8217;s specific to the page, it&#8217;s probably in PageName.js.</p>
<p>The only exception is dynamically-added event handlers (i.e. ones that aren&#8217;t always on), since it&#8217;s not appropriate to wire those up inside $(function () { &#8230; }). But in those cases, the elements are often themselves added dynamically, or if they&#8217;re not, then the event-adding process is so crucial to the page that it should be obvious enough to look for a function like ProcessCalendarActions() or the like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Lazaris</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6315</link>
		<dc:creator>Louis Lazaris</dc:creator>
		<pubDate>Tue, 03 Aug 2010 14:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6315</guid>
		<description>Yes, that&#039;s pretty cool. In my version, all I see is the selector it&#039;s acting upon in the top right corner.

Well, I guess this is certainly a much better way to track down events. Thanks a lot, Nick.</description>
		<content:encoded><![CDATA[<p>Yes, that&#8217;s pretty cool. In my version, all I see is the selector it&#8217;s acting upon in the top right corner.</p>
<p>Well, I guess this is certainly a much better way to track down events. Thanks a lot, Nick.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6314</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 03 Aug 2010 14:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6314</guid>
		<description>Sure, I uploaded a screenshot to http://img824.imageshack.us/img824/4363/chromeeventhandler.png.

Notice in the upper right hand corner you can see the file name and line number.  Clicking on it brings you directly to the handler.

I guess chrome 5 doesn&#039;t yet have it, but if you want to give it a shot without upgrading, check out chrome canary:

http://googlesystem.blogspot.com/2010/07/google-chrome-canary-build.html</description>
		<content:encoded><![CDATA[<p>Sure, I uploaded a screenshot to <a href="http://img824.imageshack.us/img824/4363/chromeeventhandler.png" rel="nofollow">http://img824.imageshack.us/img824/4363/chromeeventhandler.png</a>.</p>
<p>Notice in the upper right hand corner you can see the file name and line number.  Clicking on it brings you directly to the handler.</p>
<p>I guess chrome 5 doesn&#8217;t yet have it, but if you want to give it a shot without upgrading, check out chrome canary:</p>
<p><a href="http://googlesystem.blogspot.com/2010/07/google-chrome-canary-build.html" rel="nofollow">http://googlesystem.blogspot.com/2010/07/google-chrome-canary-build.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Lazaris</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6308</link>
		<dc:creator>Louis Lazaris</dc:creator>
		<pubDate>Tue, 03 Aug 2010 03:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6308</guid>
		<description>Hm... that&#039;s odd, because I don&#039;t see that in my dev tools on Chrome. I just see the details on the listener, and the snippet of code associated with it.

I&#039;m using Chrome 5.x. Not sure if that would affect such a feature (maybe if it&#039;s new?).

Can you send a screenshot?</description>
		<content:encoded><![CDATA[<p>Hm&#8230; that&#8217;s odd, because I don&#8217;t see that in my dev tools on Chrome. I just see the details on the listener, and the snippet of code associated with it.</p>
<p>I&#8217;m using Chrome 5.x. Not sure if that would affect such a feature (maybe if it&#8217;s new?).</p>
<p>Can you send a screenshot?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6300</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 02 Aug 2010 13:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6300</guid>
		<description>I&#039;m not sure I follow you.  I&#039;m inspecting an element and I see all the listeners listed.  When I expand a listener, on the right, I see a file name and line number.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I follow you.  I&#8217;m inspecting an element and I see all the listeners listed.  When I expand a listener, on the right, I see a file name and line number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Lazaris</title>
		<link>http://www.impressivewebs.com/unobtrusive-javascript-practical/#comment-6294</link>
		<dc:creator>Louis Lazaris</dc:creator>
		<pubDate>Sun, 01 Aug 2010 10:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.impressivewebs.com/?p=2074#comment-6294</guid>
		<description>Nick,

That&#039;s great, thanks for pointing out that feature in Chrome dev. That does work to some extent, but from my examination of it, it still doesn&#039;t tell you what file the event is located in. So, it still requires some poking around.</description>
		<content:encoded><![CDATA[<p>Nick,</p>
<p>That&#8217;s great, thanks for pointing out that feature in Chrome dev. That does work to some extent, but from my examination of it, it still doesn&#8217;t tell you what file the event is located in. So, it still requires some poking around.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
