<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Javascript-Channel.com</title>
	<link>http://javascript-channel.com</link>
	<description>The Undernet's Premier JavaScript Channel</description>
	<pubDate>Fri, 30 Nov 2007 19:48:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>
	<language>en</language>
			<item>
		<title>Fixing HTML(5)</title>
		<link>http://javascript-channel.com/2007/11/30/fixing-html5/</link>
		<comments>http://javascript-channel.com/2007/11/30/fixing-html5/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 19:46:55 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Articles</category>
	<category>JavaScript</category>
	<category>HTML</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/11/30/fixing-html5/</guid>
		<description><![CDATA[Douglas Crockford has posted an sublimely simple article on fixing HTML  by making HTML 5 simple and sublime.  Since he&#8217;s the JavaScript God, his suggestions bode well for anyone working in the DHTML realm.  Let&#8217;s hope someone at the W3C listens to him.

]]></description>
			<content:encoded><![CDATA[<p>Douglas Crockford has posted an sublimely simple article on <a title="Fixing HTML" href="http://www.crockford.com/html/">fixing HTML</a>  by making <a title="HTML 5 Working Spec" href="http://www.whatwg.org/specs/web-apps/current-work/">HTML 5</a> simple and sublime.  Since he&#8217;s the <a title="JavaScript God" href="http://javascript.crockford.com/">JavaScript God</a>, his suggestions bode well for anyone working in the DHTML realm.  Let&#8217;s hope someone at the <a title="W3C" href="http://www.w3.org/">W3C</a> listens to him.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/11/30/fixing-html5/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Avoiding .innerHTML slowdowns</title>
		<link>http://javascript-channel.com/2007/09/13/avoiding-innerhtml-slowdowns/</link>
		<comments>http://javascript-channel.com/2007/09/13/avoiding-innerhtml-slowdowns/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 18:43:13 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Uncategorized</category>
	<category>Articles</category>
	<category>Firefox</category>
	<category>Tips</category>
	<category>JavaScript</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/09/13/avoiding-innerhtml-slowdowns/</guid>
		<description><![CDATA[You might already have figured out that .innerHTML can be way faster than using the DOM.  But did you know that when clearing out existing code the DOM can be faster than .innerHTML?  Take a look the article When innerHTML isn&#8217;t fast enough to see some impressive benchmarks and a simple solution.

]]></description>
			<content:encoded><![CDATA[<p>You might already have figured out that .innerHTML can be way faster than using the DOM.  But did you know that when clearing out existing code the DOM can be faster than .innerHTML?  Take a look the article <a title="When innerHTML isn't fast enough" href="http://blog.stevenlevithan.com/archives/faster-than-innerhtml">When innerHTML isn&#8217;t fast enough</a> to see some impressive benchmarks and a simple solution.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/09/13/avoiding-innerhtml-slowdowns/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>YSlow - Find out why your page is slow</title>
		<link>http://javascript-channel.com/2007/08/08/yslow-find-out-why-your-page-is-slow/</link>
		<comments>http://javascript-channel.com/2007/08/08/yslow-find-out-why-your-page-is-slow/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 20:52:41 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Tools</category>
	<category>Firefox</category>
	<category>Plug-ins</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/08/08/yslow-find-out-why-your-page-is-slow/</guid>
		<description><![CDATA[YSlow is a Firefox plug-in which analyzes web pages and tells you why they&#8217;re slow based on Yahoo&#8217;s rules for high performance web sites.  These rules are:

Make Fewer HTTP Requests
Use a Content Delivery Network
Add an Expires Header
Gzip Components
Put CSS at the Top
Move Scripts to the Bottom
Avoid CSS Expressions
Make JavaScript and CSS External
Reduce DNS Lookups
Minify [...]]]></description>
			<content:encoded><![CDATA[<p><a title="YSlow - Firefox Plug-in" href="https://addons.mozilla.org/en-US/firefox/addon/5369">YSlow</a> is a Firefox plug-in which analyzes web pages and tells you why they&#8217;re slow based on Yahoo&#8217;s rules for high performance web sites.  These rules are:</p>
<ol>
<li>Make Fewer HTTP Requests</li>
<li>Use a Content Delivery Network</li>
<li>Add an Expires Header</li>
<li>Gzip Components</li>
<li>Put CSS at the Top</li>
<li>Move Scripts to the Bottom</li>
<li>Avoid CSS Expressions</li>
<li>Make JavaScript and CSS External</li>
<li>Reduce DNS Lookups</li>
<li>Minify JavaScript</li>
<li>Avoid Redirects</li>
<li>Remove Duplicate Scripts</li>
<li>Configure ETags</li>
</ol>
<p>Definitely worth checking out if you need to tweak every ounce of performance you can get on certain pages.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/08/08/yslow-find-out-why-your-page-is-slow/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>JavaScript on Rails</title>
		<link>http://javascript-channel.com/2007/06/28/javascript-on-rails/</link>
		<comments>http://javascript-channel.com/2007/06/28/javascript-on-rails/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 02:31:25 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Articles</category>
	<category>News</category>
	<category>Scripts</category>
	<category>Frameworks</category>
	<category>Rhino</category>
	<category>Google</category>
	<category>Toolkits</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/06/28/javascript-on-rails/</guid>
		<description><![CDATA[With the rise in popularity of the Ruby on Rails framework it was only a matter of time before someone tried to implement it using JavaScript.  Of course, when that someone happens to work at Google then all hell breaks loose.  Here&#8217;s Steve Yegge&#8217;s reply to all the hype, which also hints at [...]]]></description>
			<content:encoded><![CDATA[<p>With the rise in popularity of the <a title="Ruby on Rails" href="http://www.rubyonrails.org/">Ruby on Rails</a> framework it was only a matter of time before someone <a title="Trim Junction" href="http://code.google.com/p/trimpath/wiki/TrimJunction">tried to implement it using JavaScript</a>.  Of course, when that someone happens to work at Google then <a title="Google Bits thumb at Ruby and Ports Rails to JavaScript" href="http://www.rubyinside.com/google-bites-thumb-at-ruby-ports-rails-to-javascript-542.html">all hell breaks loose</a>.  Here&#8217;s <a title="Rhino on Rails" href="http://steve-yegge.blogspot.com/2007/06/rhino-on-rails.html">Steve Yegge&#8217;s reply to all the hype</a>, which also hints at the evolution of <a title="Mozilla Rhino" href="http://www.mozilla.org/rhino/">Rhino</a>, which is essentially JavaScript for Java.  If you&#8217;re not familiar with Rhino, check out what Steve has to say about it:</p>
<blockquote><p>Rhino&#8230;was written with an eye for performance. The Rhino code base reads almost like C code: it avoids allocation and does as much as possible with jump tables to avoid the overhead of virtual method lookups. It has two code paths: a bytecode interpreter that runs in a tight loop, and an optimizing Java bytecode compiler that turns many expensive-ish JavaScript property lookups into Java local or instance-variable lookups. It&#8217;s a pretty serious piece of software.</p>
<p>When you start digging into Rhino, you find unexpected depth. JavaScript (unlike Perl, Python and Ruby, at least today) actually has a real <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">specification</a>, and Rhino follows it rigorously, aiming for complete SpiderMonkey compatibility within the bounds allowed by the different language platforms. Rhino also offers rich configurability, has well-defined multi-threading semantics, has a full set of hooks for debugging and profiling, and much more besides. There&#8217;s a lot under the hood.</p>
<p>Oh, and Sun is now bundling it with the JDK; it&#8217;s javax.script in Java 6. With that kind of endorsement it would have been hard to justify using anything else, even if some language other than Jython or JavaScript had been up for consideration.</p></blockquote>
<p>With an endorsement like that and the potential for easy integration in an IDE with <a title="Google Web Toolkit" href="http://code.google.com/webtoolkit/">Google&#8217;s GWT</a> you can expect to hear a lot more about Rhino on Rails in the coming year.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/06/28/javascript-on-rails/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Default arguments in JavaScript</title>
		<link>http://javascript-channel.com/2007/06/05/default-arguments-in-javascript/</link>
		<comments>http://javascript-channel.com/2007/06/05/default-arguments-in-javascript/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 11:48:36 +0000</pubDate>
		<dc:creator>fatbrain</dc:creator>
		
	<category>Articles</category>
	<category>Tutorials</category>
	<category>Scripts</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/06/05/default-arguments-in-javascript/</guid>
		<description><![CDATA[I sometimes run into people who need (whatever the reason may be) to be able to give default argument values in a JavaScript function. Similar to what you find in C++:
void foo(int a, int b = 42) {
//b is set to 42 automatically if no value is defined
...
}
I felt an urge to do it, so [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes run into people who need (whatever the reason may be) to be able to give default argument values in a JavaScript function. Similar to what you find in C++:</p>
<pre>void foo(int a, int b = 42) {
//b is set to 42 automatically if no value is defined
...
}</pre>
<p>I felt an urge to do it, so I sat down for a few minutes, trying to conjure something nifty that would be intuitive enough for even me to use.</p>
<p>The solution I came up with, and that hopefully will put an end to the default-arguments rant for good.</p>
<p>The solution is quite simple, and very intuitive. It may have some shortcomings but keep in mind I didn&#8217;t explicitly write it for you. You could probably modify my solution to fit your needs anyway.</p>
<p>I&#8217;ve seen a lot of developers (including myself, long time ago) using this pattern as a workaround for the lack of built-in support for default-arguments.</p>
<pre>function foo(a, b)
{
a = typeof(a) != 'undefined' ? a : 42;
b = typeof(b) != 'undefined' ? b : 'default_b';
...
}</pre>
<p>Which most developers probably find sufficient, I don&#8217;t.</p>
<p>The solution may look scary at a quick first glance, but bear with me. I&#8217;ll start by writing the framework-code. The code that will be required for this thing to work.</p>
<pre>Function.prototype.defaults = function()
{
var _f = this;
var _a = Array(_f.length-arguments.length).concat(
Array.prototype.slice.apply(arguments));
return function()
{
return _f.apply(_f, Array.prototype.slice.apply(arguments).concat(
_a.slice(arguments.length, _a.length)));
}
}</pre>
<p>See that wasn&#8217;t so scary <img src='http://javascript-channel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>In order for this to work you have to declare you functions in a special way. There are basically two ways of declaring a function.</p>
<pre>function foo(a, b)
{
...
}</pre>
<p>Is identical to (apart from the lexical difference, and some other minor things)</p>
<pre>var foo = function(a, b)
{
...
}</pre>
<p>In order for this solution to work you have to declare all functions on which you wish to have default-arguments the latter way.</p>
<p>Usage</p>
<pre>var foo = function(a, b)
{
...
}.defaults(42, 'default_b');</pre>
<p>Is identical to the first code-block but without adding any code in the function-body.</p>
<p>Example</p>
<pre>var bar = function(a, b)
{
}.defaults('default_b');
bar();
// a = undefined, b = 'default_b'
bar(1);
// a = 1, b = 'default_b'
bar(1, 'some_value');
// a = 1, b = 'some_value'</pre>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/06/05/default-arguments-in-javascript/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Finally, a decent JS Tutorial!</title>
		<link>http://javascript-channel.com/2007/05/15/finally-a-decent-js-tutorial/</link>
		<comments>http://javascript-channel.com/2007/05/15/finally-a-decent-js-tutorial/#comments</comments>
		<pubDate>Tue, 15 May 2007 20:40:02 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Tutorials</category>
	<category>Ajax</category>
	<category>JSON</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/05/15/finally-a-decent-js-tutorial/</guid>
		<description><![CDATA[The lack of a proper JavaScript tutorial on the web is well known to the members of this channel.  We&#8217;ve even tried our own half-arsed versions once or twice.  But I was pleasantly surprised to find Essential Javascript - A Javascript Tutorial.
This tutorial is clean and concise, covering basics such as variables, functions, [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" id="image25" alt="Essential Javascript - A Javascript Tutorial" src="http://javascript-channel.com/wp-content/uploads/2007/05/js-tutorial.png" />The lack of a proper JavaScript tutorial on the web is well known to the members of this channel.  We&#8217;ve even tried our own half-arsed versions once or twice.  But I was pleasantly surprised to find <a title="Essential Javascript - A Javascript Tutorial" href="http://www.hunlock.com/blogs/Essential_Javascript_--_A_Javascript_Tutorial">Essential Javascript - A Javascript Tutorial</a>.</p>
<p>This tutorial is clean and concise, covering basics such as variables, functions, events, math and dates.  A nice feature is the code doesn&#8217;t look like it dates to 1998.  The tutorial is actually several tutorials, and also covers popular topics such as <a title="AJAX for n00bs!" href="http://www.hunlock.com/blogs/AJAX_for_n00bs">AJAX for Noobs</a> and <a title="Javascript Object Notation Tutorial" href="http://www.hunlock.com/blogs/Mastering_JSON_(_JavaScript_Object_Notation_)">JSON</a>. An excellent resource for those just learning the language or eager to dive into more advanced topics but lacking fundamentals.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/05/15/finally-a-decent-js-tutorial/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Great scripts for sprucing up your web applications</title>
		<link>http://javascript-channel.com/2007/03/27/great-scripts-for-sprucing-up-your-web-applications/</link>
		<comments>http://javascript-channel.com/2007/03/27/great-scripts-for-sprucing-up-your-web-applications/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 17:08:55 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Ajax</category>
	<category>Tools</category>
	<category>Scripts</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/03/27/great-scripts-for-sprucing-up-your-web-applications/</guid>
		<description><![CDATA[Igglo.co.uk has posted a collection of links for 15 interesting javascript scripts.
While none of the scripts are new they are all both nice and potentially useful for sprucing up your site or webapp.  Some of the scripts aim at visual effects such as loading and fading an image or putting hot spots on a [...]]]></description>
			<content:encoded><![CDATA[<p>Igglo.co.uk has posted a collection of links for <a title="15 JavaScript Snippets You Can't Live Without" href="http://www.igglo.co.uk/6/15-javascript-snippets-you-cant-live-without/">15 interesting javascript scripts</a>.</p>
<p>While none of the scripts are new they are all both nice and potentially useful for sprucing up your site or webapp.  Some of the scripts aim at visual effects such as <a title="Loading and Fading an image with JavaScript" href="http://clagnut.com/sandbox/imagefades/">loading and fading an image</a> or <a title="A List Apart: A more accessible map" href="http://www.alistapart.com/articles/cssmaps">putting hot spots on a map</a>, while others such as <a title="Lighbox JavaScript Modal Image Popup and Gallery" href="http://www.huddletogether.com/projects/lightbox2/">Lightbox</a> are regularly mentioned on the irc channel.  There are also updated versions of ubiquitous tools like a <a title="The DHTML JavaScript Calendar" href="http://www.dynarch.com/projects/calendar/">date picker calendar</a> and <a title="Form Input Auto complete script" href="http://demo.script.aculo.us/ajax/autocompleter">auto complete</a>.</p>
<p>These are not just snippets of code but full blown scripts, so you should get productive results from them right away, and all are free for anyone to use.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/03/27/great-scripts-for-sprucing-up-your-web-applications/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Prototyping with the JavaScript Prototype Object</title>
		<link>http://javascript-channel.com/2007/03/26/prototyping-with-the-javascript-prototype-object/</link>
		<comments>http://javascript-channel.com/2007/03/26/prototyping-with-the-javascript-prototype-object/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 03:44:08 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Tools</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/03/26/prototyping-with-the-javascript-prototype-object/</guid>
		<description><![CDATA[One of the most important features in JavaScript is the ability allow objects to inherit methods through the use of prototyping.  Anyone who had a toolkit of JavaScript functions is well served by also putting to use prototypes to fill in the gaps where existing functions are missing, such as a simple String.trim() function.
A [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most important features in JavaScript is the ability allow objects to inherit methods through the use of <a title="JavaScript Prototyping Tutorial" href="http://www.javascriptkit.com/javatutors/proto.shtml">prototyping</a>.  Anyone who had a toolkit of JavaScript functions is well served by also putting to use prototypes to fill in the gaps where existing functions are missing, such as a simple String.trim() function.</p>
<p>A lot of prototyping toolkits exist, with <a title="Prototype JavaScript Framework" href="http://www.prototypejs.org/">Prototype</a> (yeah, they stole the name) being the most popular one, but at 92KB, some consider Prototype a bit heavy for what they need.  If you happen to be one of those people, then you may be interested in picking and choosing prototype methods from the following two resources.</p>
<p>The first is <a title="Useful Prototype Methods for JavaScript" href="http://www.svendtofte.com/code/usefull_prototypes/">Svend Tofte&#8217;s Usefull Prototype Methods for JavaScript</a> (sic).  Svend&#8217;s collection of a dozen methods weighs in at a tiny 2KB, and it&#8217;s all modular enough that you can pick and choose the methods you like the most.</p>
<p>The second is Henlock&#8217;s <a title="Ten JavaScript Tools" href="http://www.hunlock.com/blogs/Ten_Javascript_Tools_Everyone_Should_Have">Ten JavaScript Tools Everyone Should Have</a>.  I find his methods to be a bit more useful than Svend&#8217;s, and he mentions a few additional resources at the bottom of his page.</p>
<p>So what prototype methods are a must for you?
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/03/26/prototyping-with-the-javascript-prototype-object/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>JavaScript Cheat Sheet</title>
		<link>http://javascript-channel.com/2007/02/12/javascript-cheat-sheet/</link>
		<comments>http://javascript-channel.com/2007/02/12/javascript-cheat-sheet/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 03:04:08 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Reference</category>
		<guid isPermaLink="false">http://javascript-channel.com/2007/02/12/javascript-cheat-sheet/</guid>
		<description><![CDATA[I found an excellent JavaScript Cheat Sheet recently when someone was asking for JS documentation. It covers everything from functions and methods to XMLHttpRequest and regular expressions. Best of all, it has both PNG and PDF versions available for download.
Everyone should have some sort of quick reference when it comes to JavaScript, the language&#8217;s ease [...]]]></description>
			<content:encoded><![CDATA[<p>I found an excellent <a title="JavaScript Cheat Sheet" href="http://www.ilovejackdaniels.com/cheat-sheets/javascript-cheat-sheet/">JavaScript Cheat Sheet</a> recently when someone was asking for JS documentation. It covers everything from functions and methods to XMLHttpRequest and regular expressions. Best of all, it has both PNG and PDF versions available for download.</p>
<p>Everyone should have some sort of quick reference when it comes to JavaScript, the language&#8217;s ease of use lends itself to a light document that can quickly be looked up. Personally I&#8217;ve only ever used <a title="O'Reilly JavaScript Pocket Reference" href="http://www.oreilly.com/catalog/jscriptpr2/">O&#8217;Reilly JavaScript Pocket Reference</a> as my JS book. For anything more complicated I was always better served by Google.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2007/02/12/javascript-cheat-sheet/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>RTFAPI!</title>
		<link>http://javascript-channel.com/2006/09/21/rtfapi/</link>
		<comments>http://javascript-channel.com/2006/09/21/rtfapi/#comments</comments>
		<pubDate>Thu, 21 Sep 2006 17:45:56 +0000</pubDate>
		<dc:creator>furtive</dc:creator>
		
	<category>Reference</category>
		<guid isPermaLink="false">http://javascript-channel.com/2006/09/21/rtfapi/</guid>
		<description><![CDATA[If you don&#8217;t know how to us Google effectively and have yet to memorise all the APIs out there then you might enjoy the consolidated practicality of gotAPI.com.  Although the interface may leave something to be desired, gotAPI.com&#8217;s usefulness cannot be denied.

]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know how to us <a title="Google Advanced Search Made Easy" href="http://www.google.com/help/refinesearch.html">Google effectively</a> and have yet to memorise all the APIs out there then you might enjoy the consolidated practicality of <a title="Got API?" href="http://www.gotAPI.com">gotAPI.com</a>.  Although the interface may leave something to be desired, <a title="Got API?" href="http://www.gotAPI.com">gotAPI.com</a>&#8217;s usefulness cannot be denied.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://javascript-channel.com/2006/09/21/rtfapi/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
