<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Sorting a Table with Javascript</title>
	<link>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/</link>
	<description>Graphic Artist / Web Developer</description>
	<pubDate>Sun, 23 Nov 2008 11:31:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>

	<item>
		<title>By: Andy</title>
		<link>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-10</link>
		<author>Andy</author>
		<pubDate>Tue, 11 Apr 2006 11:40:45 +0000</pubDate>
		<guid>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-10</guid>
					<description>That does look pretty neat, I must give prototype a try - especially since it looks like they've stopped messing with Object.prototype :)

I've been using Dean Edwards CSS Query script - http://dean.edwards.name/my/cssQuery/ - for a current project, which I've been very impressed with. I wonder how prototype's $$() compares with it?</description>
		<content:encoded><![CDATA[<p>That does look pretty neat, I must give prototype a try &#8211; especially since it looks like they&#8217;ve stopped messing with Object.prototype <img src='http://www.deletem3.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve been using Dean Edwards <span class="caps">CSS </span>Query script &#8211; <a href="http://dean.edwards.name/my/cssQuery/" rel="nofollow">http://dean.edwards.name/my/cssQuery/</a> &#8211; for a current project, which I&#8217;ve been very impressed with. I wonder how prototype&#8217;s $$() compares with it?</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Jules</title>
		<link>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-22</link>
		<author>Jules</author>
		<pubDate>Fri, 23 Jun 2006 10:55:37 +0000</pubDate>
		<guid>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-22</guid>
					<description>I don't know if prototype supports more or less selectors than css Query, but it certainly does support a lot.

Give event:Selectors a try:

http://encytemedia.com/event-selectors/

It's based on prototypes $$ function, and it allows you to do:

var Rules = {
	'#mylist li:click': function(e) {
	  // do something with e
	}
}

EventSelectors.start(Rules);

Rather than:

function initializeFunctions(){
	$$('#mylist li').each(function(e)
	{
		e.onclick = function()
		{
			// do something with e
		}
	}
}

window.onload = function(){
	initializeFunctions()
}</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know if prototype supports more or less selectors than css Query, but it certainly does support a lot.</p>
<p>Give event:Selectors a try:</p>
<p><a href="http://encytemedia.com/event-selectors/" rel="nofollow">http://encytemedia.com/event-selectors/</a></p>
<p>It&#8217;s based on prototypes $$ function, and it allows you to do:</p>
<p>var Rules = {<br />
&#8216;#mylist li:click&#8217;: function(e) {</p>
<p>  // do something with e<br />
}</p>
<p>}</p>
<p>EventSelectors.start(Rules);</p>
<p>Rather than:</p>
<p>function initializeFunctions(){<br />
$$(&#8216;#mylist li&#8217;).each(function(e)<br />
{</p>
<p>e.onclick = function()<br />
{</p>
<p>// do something with e<br />
}</p>
<p>}<br />
}</p>
<p>window.onload = function(){<br />
initializeFunctions()<br />
}</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Rich LaMarche</title>
		<link>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-56</link>
		<author>Rich LaMarche</author>
		<pubDate>Wed, 09 Aug 2006 04:42:53 +0000</pubDate>
		<guid>http://www.deletem3.com/2006/04/01/sorting-a-table-with-javascript/#comment-56</guid>
					<description>Check this page out - http://www.ericvasilik.com/2006/07/code-karma.html - for a good explaination of why your page doesn't work in IE.  In the comments here - http://www.ajaxian.com/archives/innerhtml-gotchas - from Paul Chiu is a fitting solution for your code.

You can replace:
Element.replace($$(".genericTable tbody").first(), sortedRowsHTML);

With
ieTableInnerHTML($$(".genericTable tbody").first(), sortedRowsHTML);

after droping in his function and your code will work in IE and Firefox.

-Rich</description>
		<content:encoded><![CDATA[<p>Check this page out &#8211; <a href="http://www.ericvasilik.com/2006/07/code-karma.html" rel="nofollow">http://www.ericvasilik.com/2006/07/code-karma.html</a> &#8211; for a good explaination of why your page doesn&#8217;t work in IE.  In the comments here &#8211; <a href="http://www.ajaxian.com/archives/innerhtml-gotchas" rel="nofollow">http://www.ajaxian.com/archives/innerhtml-gotchas</a> &#8211; from Paul Chiu is a fitting solution for your code.</p>
<p>You can replace:<br />
Element.replace($$(&#8220;.genericTable tbody&#8221;).first(), sortedRowsHTML);</p>
<p>With<br />
ieTableInnerHTML($$(&#8220;.genericTable tbody&#8221;).first(), sortedRowsHTML);</p>
<p>after droping in his function and your code will work in IE and Firefox.</p>
<p>-Rich</p>
]]></content:encoded>
				</item>
</channel>
</rss>
