<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- generator="wordpress/2.3.1" --><rss 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/" version="2.0">

<channel>
	<title>Javascript Kata</title>
	<link>http://www.javascriptkata.com</link>
	<description>Advanced katas for javascripters</description>
	<pubDate>Fri, 14 Mar 2008 15:39:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/javascriptkata/no_echo_chamber" type="application/rss+xml" /><item>
		<title>Load a page with javascript</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/</link>
		<comments>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 14:31:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[Ask Dan a javascript question]]></category>

		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/</guid>
		<description><![CDATA[Someone asked me : "I would like this site to automatically load a certain page (1-31) depending on what day of the month it is (1-31)"]]></description>
			<content:encoded><![CDATA[<p>I receive javascript-related questions in my inbox from time to time and here&#8217;s the last one.</p>
<blockquote><p> I am ok with HTML but awfully new to JavaScript and I know very little at this point. My question is for this web site I&#8217;m building. I need to know the exact JavaScript code and placement of the code in an HTML document for this goal. I would like this site to <strong>automatically load a certain page (1-31) depending on what day of the month it is (1-31)</strong>. I don&#8217;t need to worry about what month or year it is, just the date in the month. For instance when it is the eleventh day in the month, page11.html will automatically load when you click on to the site. I would like it to take the time(Date) from the client side not the server. This way no mater what time zone your in the right HTML page will pop up at midnight.</p></blockquote>
<p>Most people can&#8217;t give the <em>exact javascript code placement of the code in an HTML document</em> because it would always be buggy. They can give hints and/or snippets of code but rarely a complete working piece. Sorry&#8230;</p>
<p>Secondly, relying on javascript to do all this work would be a mistake because <strong>if javascript is disabled, the site will not work</strong>. Most users have javascript enabled but you should always think about web-crawlers (google, yahoo!, etc) that will try to index your page but will hit an empty page.</p>
<p>It&#8217;s always hard to guess all the reasons why someone would want a different page everyday of the month and I don&#8217;t know more about the project than what is written above. Considering this, maybe there are just parts of the page that are changing everyday and you could load them on the server-side thus having a single page loading including other pages depending on the day. The problem is that you would have to ask the timezone of the user and keep it in a cookie.</p>
<p>Just remember, <strong>javascript should not be a requirement to navigate in a site</strong>.</p>
<p>Finally, if I would really want to load a complete new page in javascript, I would do the following.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> dayOfTheMonth = <span class="br0">&#40;</span><span class="kw2">new</span> Date<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">getDate</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">location.<span class="me1">href</span>=<span class="st0">&quot;page&quot;</span> + dayOfTheMonth.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="st0">&quot;.html&quot;</span>;</div>
</li>
</ol>
</div>
<p style="margin-bottom: 2em">&nbsp;</p>
<p>This is the way I would do it, <strong>do you have any other suggestions?</strong></p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=YXh8k0"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=YXh8k0" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to have jQuery and prototype.js in the same project</title>
		<link>http://www.javascriptkata.com/2008/01/28/how-to-have-jquery-and-prototypejs-in-the-same-project/</link>
		<comments>http://www.javascriptkata.com/2008/01/28/how-to-have-jquery-and-prototypejs-in-the-same-project/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 11:02:41 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[black belt]]></category>

		<category><![CDATA[how to]]></category>

		<category><![CDATA[librairies]]></category>

		<guid isPermaLink="false">http://www.javascriptkata.com/2008/01/28/how-to-have-jquery-and-prototypejs-in-the-same-project/</guid>
		<description><![CDATA[I&#8217;m a big fan of jQuery. This librarie is just the best and simplest one around. I really noticed it when I wanted to get rid of jQuery in TimmyOnTime and try to use prototype.js instead, just to be more &#8220;rails-oriented&#8221; (that&#8217;s a pretty lame excuse don&#8217;t you think?)
Why I didn&#8217;t like prototype.js
There was not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of <a href="http://jquery.com/" target="_blank">jQuery</a>. This librarie is just the <strong>best</strong> and <strong>simplest</strong> one around. I really noticed it when I wanted to get rid of jQuery in <a href="http://timmyontime.com/" target="_blank">TimmyOnTime</a> and try to use <a href="http://www.prototypejs.org/" target="_blank">prototype.js</a> instead, just to be more &#8220;rails-oriented&#8221; (that&#8217;s a pretty lame excuse don&#8217;t you think?)</p>
<h3>Why I didn&#8217;t like prototype.js</h3>
<p>There was not a lot of javascript written for the project so I thought that getting rid of jQuery and using prototype.js would be easy. It turned out to be hell on earth. <strong>Prototype.js made me feel like I was back in the 90s writing C++</strong>. A simple click event turns out to be a awful lot of ugly code with ugly function names.</p>
<p>Example, <strong>if I wanted to show the content of a DIV I clicked</strong> in prototype.js, I would use things like <a href="http://www.prototypejs.org/api/event/observe" target="_blank">Event.observe</a>, <a href="http://www.prototypejs.org/api/function/bindAsEventListener" target="_blank">bindAsEventListener</a>, a mix of native DOM element and prototype.js element, and worst of all, an <a href="http://www.prototypejs.org/api">unintelligible documentation</a>.</p>
<p>jQuery as a complete different way of doing it in a single easy-to-understand line :<br />
<em>$(&#8221;#a_div&#8221;).click(function() { alert($(this).text()); });</em>.<br />
As simple as that!</p>
<h3>The problem</h3>
<p>I wanted to use some interface element in Rails that requires prototype.js so I had to have both librairies. The problem is that there&#8217;s a conflict between them. Prototype.js doesn&#8217;t seem to give a damn about it but jQuery is nicer with you. It offers a <a href="http://docs.jquery.com/Core/jQuery.noConflict" target="_blank">noConflict</a> method.</p>
<p><strong>With Rails</strong>, prototype.js is the default librairie so to override this, you could do</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;%= javascript_include_tag &quot;prototype&quot;, &quot;jquery&quot; %&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;script&gt;$j = jQuery.noConflict();&lt;/script&gt;</div>
</li>
</ol>
</div>
<p>This way, you will have to use <strong>$j</strong> instead of <strong>$</strong> to call jQuery.<strong>$</strong> would still call prototype.</p>
<p>Another thing you could do is to use <a href="http://ennerchi.com/projects/jrails" target="_blank">jQuery on Rails</a> and don&#8217;t give a damn about scriptaculous. I personally prefer to use librairies that are fully tested instead of using a &#8220;by-pass&#8221; that could break my code. It&#8217;s your choice&#8230;</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=WDyBBu"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=WDyBBu" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2008/01/28/how-to-have-jquery-and-prototypejs-in-the-same-project/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New on Javascript Kata : the echo chamber</title>
		<link>http://www.javascriptkata.com/2008/01/08/new-on-javascript-kata-the-echo-chamber/</link>
		<comments>http://www.javascriptkata.com/2008/01/08/new-on-javascript-kata-the-echo-chamber/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 22:55:55 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://www.javascriptkata.com/2008/01/08/new-on-javascript-kata-the-echo-chamber/</guid>
		<description><![CDATA[Since the beginning of the new year, I&#8217;m offering to javascripters the echo chamber. What is it? It&#8217;s a category where I will post news about what happens in the javascript world. I will try to avoid ajax related news because Ajaxian already does the job really well.
You can subscribe to the RSS feed with [...]]]></description>
			<content:encoded><![CDATA[<p>Since the beginning of the new year, I&#8217;m offering to javascripters the <a href="http://www.javascriptkata.com/category/echo-chamber/">echo chamber</a>. What is it? It&#8217;s <strong>a category where I will post news about what happens in the javascript world</strong>. I will try to avoid ajax related news because <a href="http://ajaxian.com/" target="_blank">Ajaxian</a> already does the job really well.</p>
<p>You can subscribe to the RSS feed with <a href="http://feeds.feedburner.com/JavascriptKata">all the articles</a> or to the RSS feed<a href="http://feeds.feedburner.com/javascriptkata/no_echo_chamber"> without the articles from the echo chamber</a>.</p>
<p>Some may have noticed that I redesigned the site. The <a href='http://www.javascriptkata.com/wp-content/uploads/2008/01/js_old.jpg' title='Javascript Kata - old design'>old design</a> was long overdue and it was a pleasure for my eyes to have a new one.</p>
<p>I would also like to have your <strong>feedback on what you think of the new echo chamber and design</strong>?</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=6YLiMw"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=6YLiMw" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2008/01/08/new-on-javascript-kata-the-echo-chamber/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ask Dan : More on javascript threading</title>
		<link>http://www.javascriptkata.com/2007/12/06/ask-dan-more-on-javascript-threading/</link>
		<comments>http://www.javascriptkata.com/2007/12/06/ask-dan-more-on-javascript-threading/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 14:05:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[Ask Dan a javascript question]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[black belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=31</guid>
		<description><![CDATA[From time to time, I receive emails from desperate people who want help with their javascript problem. I also receive a lot of emails of people wanting to help me with my &#8220;manly problems&#8221;. It&#8217;s very nice from them to care about me and I take time to reply to each of them but I [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time, I receive emails from desperate people who want help with their javascript problem. I also receive a lot of emails of people wanting to help me with my &#8220;manly problems&#8221;. It&#8217;s very nice from them to care about me and I take time to reply to each of them but I don&#8217;t have that kind of problem for the moment.</p>
<p><strong>Stuart Cooper</strong> recently sent me a mail about threading in javascript and I turn to you, javascripters, to find the a solution for his problem. I <a href="http://refactormycode.com/codes/172-javascript-threading" target="_blank">sent the code on RefactorMyCode for refactorisation</a> and they will automatically show up in the comments of this post (the site is an idea of <a href="http://macournoyer.wordpress.com/" target="_blank">Marc-AndrÃ© Cournoyer</a> who is a very active developer from Montreal). <strong>Don&#8217;t be afraid to think outside the box</strong>. The solution may be completly different from what is already written.</p>
<hr /><em> I am experience trying to create a &#8220;cover page&#8221; that runs a ping to remote servers.In my code I am using setInterval() to run repeating pings (artificially quickly at the moment, ie 10 seconds rather than 1 min) and display the results to browser.  I have built my own XMLHttpRequest module (mainly as a learning exercise) and I don&#8217;t believe it to be the source of my ills.</em><em> </em><em>I have read through your article and the behaviour of alert() and confirm() fits exactly with what I am seeing when I run the following code :</em><em>[snippet]</em></p>
<p><em>function startup(){</em></p>
<p><em>setInterval(&#8221;pinger(&#8217;live&#8217;,0)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;standby&#8217;,1)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;dev&#8217;,2)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;test1&#8242;,3)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;test2&#8242;,4)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;test3&#8242;,5)&#8221;,10000);<br />
setInterval(&#8221;pinger(&#8217;test4&#8242;,6)&#8221;,10000);</em></p>
<p><em>}</em></p>
<p><em>function pinger(server,divit){</em></p>
<p><em>console=document.getElementById(&#8217;ping_div&#8217; + divit);<br />
console.innerHTML=&#8221;;<br />
sendRequest(&#8221;../php/ping_sys2.php?target=&#8221; + server);</em></p>
<p><em>}</em></p>
<p><em>[/snippet]</em></p>
<p><em>(each server has its own named div to return to)</em></p>
<p><em>What I am seeing when I run this is the final pinger response from the callback and nothing else.  I since added debugging into my XMLHttpRequest code so that it split out the server response progress.</em></p>
<p><em>[snippet]</em></p>
<p><em>readyXML=xmlReq.readyState;</em></p>
<p><em>[/snippet]</em></p>
<p><em>[snippet]</em></p>
<p><em>if(readyXML == 3){</em></p>
<p><em>data=&#8221;Serving &#8230;&#8221;;</em></p>
<p><em>}</em></p>
<p><em>if(readyXML == 2){</em></p>
<p><em>data=&#8221;Sent &#8230;&#8221;;</em></p>
<p><em>}</em></p>
<p><em>if(readyXML == 1){</em></p>
<p><em>data=&#8221;Opening &#8230;&#8221;;</em></p>
<p><em>}</em></p>
<p><em>[/snippet]</em></p>
<p><em>What I have observed is that when running the setInterval commands as above, all except the final request are &#8220;jammed&#8221; on readyState = 1 and appropriately responds with &#8220;Sending â€¦&#8221;</em></p>
<p><em>however,</em></p>
<p><em>when I do the following (which is messy)</em></p>
<p><em>[snippet]</em></p>
<p><em>function startup(){</em></p>
<p><em>setInterval(&#8221;pinger(&#8217;live&#8217;,0)&#8221;,1000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;standby&#8217;,1)&#8221;,10000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;dev&#8217;,2)&#8221;,10000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;test1&#8242;,3)&#8221;,10000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;test2&#8242;,4)&#8221;,10000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;test3&#8242;,5)&#8221;,10000);<br />
alert(&#8221;something&#8221;);<br />
setInterval(&#8221;pinger(&#8217;test4&#8242;,6)&#8221;,10000);</em></p>
<p><em>}</em></p>
<p><em>[/snippet]</em></p>
<p><em>Each response is absolutely spot on and will continue to generate pings correctly.  So in this case the script alert interrupts are forcing the callback request to trigger, whereas without the alerts its only the last request that triggers a callback.  I have also tried using artificial timeout loops instead of alerts (which generate the odd browser &#8220;script running slowly&#8221; message) but to no avail.</em></p>
<p><em>At the moment I am almost resigned to having to create individual events (like rollovers, though I would much prefer the ping initialisation to occur window.onLoad()) that trigger the setInterval() â€¦ which also seems to work fine.</em></p>
<p><em>I am hoping that you may have come across a way of forcing the XMLHttpRequest to respond without forcing alerts or confirms on the user, in the time since the last update to the article.</em></p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=Z8tjI2"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=Z8tjI2" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/12/06/ask-dan-more-on-javascript-threading/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A new project - I hate PHP</title>
		<link>http://www.javascriptkata.com/2007/12/05/a-new-project-i-hate-php/</link>
		<comments>http://www.javascriptkata.com/2007/12/05/a-new-project-i-hate-php/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 15:55:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=55</guid>
		<description><![CDATA[If you are  javascripter, chances are that you must work with some back-end languages like ASP.NET, ColdFusion, Ruby On Rails or PHP. If you work with a back-end language, chances are that you become frustrated against it sometimes. That&#8217;s why I created I hate PHP.
What is it?
I hate PHP helps you to evacuate your [...]]]></description>
			<content:encoded><![CDATA[<p>If you are  javascripter, chances are that you must work with some back-end languages like ASP.NET, ColdFusion, Ruby On Rails or <strong>PHP</strong>. If you work with a back-end language, chances are that <strong>you become frustrated against it</strong> sometimes. That&#8217;s why I created <a href="http://www.ihatephp.net/" target="_blank">I hate PHP</a>.</p>
<h3>What is it?</h3>
<p><a href="http://www.ihatephp.net/" target="_blank">I hate PHP</a> helps you to evacuate your daily frustrations against the PHP language via <a href="http://www.twitter.com" target="_blank">Twitter</a>. It&#8217;s simple. You must tell your <em>twitter username</em> to <em>I hate PHP</em> (on the website) and then, send a direct message to the <a href="http://twitter.com/ihatephp" target="_blank">ihatephp twitter user</a> in the following format : <strong>d ihatephp <em>a thing that frustrates you in PHP</em></strong>.</p>
<h3>Why against PHP?</h3>
<p>I could have done it against a lot of languages because <strong>they all suck in their own special way</strong>. But the moment I was thinking about the project, I was working with PHP and I just kept sending IM messages to Frank (of <a href="http://www.rubyfleebie.com/" target="_blank">Ruby Fleebie</a>) to tell him about things that frustrated me in PHP. I just made it more &#8220;official&#8221; and now I tell it to the world via <a href="http://www.ihatephp.net" target="_blank">I hate PHP</a>.</p>
<p>Subscribe to the <a href="http://feeds.feedburner.com/ihatephp" target="_blank">RSS</a> of I hate PHP!</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=ap6gX2"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=ap6gX2" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/12/05/a-new-project-i-hate-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Barcamp Montreal 3 and this site</title>
		<link>http://www.javascriptkata.com/2007/11/05/barcamp-montreal-3-and-this-site/</link>
		<comments>http://www.javascriptkata.com/2007/11/05/barcamp-montreal-3-and-this-site/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 23:52:55 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[black belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=54</guid>
		<description><![CDATA[Like most of you already knew, I&#8217;m working with Frank Lamontagne of Ruby Fleebie on a project called TimmyOnTime. We had the chance to present it at the last Barcamp Montreal and it went&#8230; really bad! If you want to know more about the whole adventure (and have a good laugh), click here to read [...]]]></description>
			<content:encoded><![CDATA[<p>Like most of you already knew, I&#8217;m working with Frank Lamontagne of <a href="http://www.rubyfleebie.com/" target="_blank">Ruby Fleebie</a> on a project called <a href="http://timmyontime.com/" target="_blank">TimmyOnTime</a>. We had the chance to present it at the last <a href="http://barcampmontreal.org/wiki/English:BarCampMontreal3">Barcamp Montreal</a> and it went&#8230; really bad! If you want to know more about the whole adventure (and have a good laugh), <a href="http://www.rubyfleebie.com/barcampmontreal3-and-acts-of-god/" target="_blank">click here</a> to read the story written by Frank. (By the way, I used a good ol&#8217; click here link just for the fun of it&#8230; I never did it before and frankly, I like it&#8230; almost&#8230;).</p>
<h3>What happens with Javascript Kata?</h3>
<p>I know, I  have been negligent with site. It&#8217;s really shameful to let a great site die and there&#8217;s no one to blame but me. Why I did that? I could give hundreds of reasons but they would all be lies. I really don&#8217;t know what happened.</p>
<p>I want to give another twist to JavascriptKata. I want to get back to a more tradional reference site because I don&#8217;t like the concept of a technical blog after all. I want the articles to be more persistent, not just a post that everyone forget about after a while.</p>
<p>But, there would be a RSS feed too. I would announce new articles on the site. I would also use it to debate on tricky things about javascript and then make an article out of it.</p>
<p>I really would like to hear you about this idea, please comment!</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=IRoySb"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=IRoySb" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/11/05/barcamp-montreal-3-and-this-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>3 reasons why I still love Firebug</title>
		<link>http://www.javascriptkata.com/2007/08/01/3-reasons-why-i-still-love-firebug/</link>
		<comments>http://www.javascriptkata.com/2007/08/01/3-reasons-why-i-still-love-firebug/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 17:32:51 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=53</guid>
		<description><![CDATA[There was a buzz around Firebug a couple of months ago. A lot of developers installed it and enjoy every second they use it. There are some others that missed the train and are still using alerts to debug. If you&#8217;re from that second category, here&#8217;s your chance to get back on tracks.
1. The console

The [...]]]></description>
			<content:encoded><![CDATA[<p>There was a buzz around <a href="http://getfirebug.com/" target="_blank">Firebug</a> a couple of months ago. A lot of developers installed it and enjoy every second they use it. There are some others that missed the train and are still using <em>alerts</em> to debug. If you&#8217;re from that second category, here&#8217;s your chance to get back on tracks.</p>
<h3>1. The console</h3>
<p><a href="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug1.jpg" title="Firebug console" target="_blank"><img src="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug1.thumbnail.jpg" alt="Firebug console" /></a></p>
<p>The console is a kind of dashboard. It shows what happens client-side : CSS, javascript error, warnings, ajax&#8230; all you want to know in just one sight.</p>
<p>If <strong>you have an error</strong>, just click on it and Firebug will open the source code and highlight it.</p>
<p>Every <strong>ajax</strong> request is also shown here along with its parameters and the response from the server.</p>
<h3>2 . Debugger</h3>
<p><a href="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug2.jpg" title="Firebug debugger"><img src="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug2.thumbnail.jpg" alt="Firebug debugger" /></a></p>
<p>The debugger is insanely efficient, it offers everything you would expect from a debugger : breakpoints, step-by-step, watch expressions and functions stack. Do you need anything more?</p>
<h3>3. Inspector</h3>
<p><a href="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug3.jpg" title="Firebug inspector"><img src="http://www.javascriptkata.com/wp-content/uploads/2007/07/firebug3.thumbnail.jpg" alt="Firebug inspector" /></a><br />
Great, there&#8217;s an alternative to the infamous &#8220;View page source and then search through the code&#8221; technique. With Firebug, you just click on <strong>Inspect</strong> and move your cursor over the element that causes the problem and you have it all in one sight : the HTML on left and the CSS style on right. You can manipulate both of them to try to correct the problem and then, it&#8217;s done.</p>
<h3>Conclusion</h3>
<p>There&#8217;s no reason in the world why you shouldn&#8217;t use Firebug, go and get it at <a href="http://getfirebug.com/" target="_blank">http://getfirebug.com/</a>.</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=LWfe75"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=LWfe75" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/08/01/3-reasons-why-i-still-love-firebug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ask Dan : Friggin’ libraries</title>
		<link>http://www.javascriptkata.com/2007/06/26/ask-dan-friggin-libraries/</link>
		<comments>http://www.javascriptkata.com/2007/06/26/ask-dan-friggin-libraries/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 13:21:06 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[Ask Dan a javascript question]]></category>

		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=49</guid>
		<description><![CDATA[I received two questions about librairies in the Ask Dan a javascript question serie. Don&#8217;t forget to ask me your questions too by sending a mail at dan@javascriptkata.com.
Effects
Camilou asked
Is it too hard to a poor mortal like me to achieve that fancy effects that some libraries like Prototype do offer? I mean, that drag-and-drop stuff [...]]]></description>
			<content:encoded><![CDATA[<p>I received two questions about librairies in the <a href="http://www.javascriptkata.com/category/ask-dan-a-javascript-question/" title="Ask Dan a javascript question">Ask Dan a javascript question</a> serie. Don&#8217;t forget to ask me your questions too by sending a mail at <a href="mailto:dan@javascriptkata.com" title="dan@javascriptkata.com">dan@javascriptkata.com</a>.</p>
<h3>Effects</h3>
<p>Camilou asked</p>
<p style="margin-left: 40px">Is it too hard to a poor mortal like me to achieve that fancy effects that some libraries like Prototype do offer? I mean, that drag-and-drop stuff looks pretty complicated to me. Or maybe I am just too noob.</p>
<p>Drag-and-drop is complicated but not that much. Thousands of people have done it before the libraries-era. But, I&#8217;d say that if you want to achieve something similar to prototype, you&#8217;ll probably work for months. Prototype is the most known javascript library and if you start today, there&#8217;s little chance you will get as far as them. Sorry. But if you have a very different and easier way of doing things, maybe you&#8217;ll succeed.</p>
<h3>Creating a new library</h3>
<p>Frank Stepanski asked</p>
<p style="margin-left: 40px"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial">If I want to start creating my own JS libraries, how do I start?<br />
</span></font><br />
If you have no better idea than re-implementing what already exists in other libraries, you&#8217;ll never know where to start. A new library should fill a hole that is not filled by anyone else. So, you&#8217;ll find where to start the day that you will want to do something and that you won&#8217;t find any library that does it.</p>
<h3>TimmyOnTime</h3>
<p>We are <a href="http://www.javascriptkata.com/2007/06/14/a-new-project-timmyontime/" title="still working">still working</a> on <a href="http://timmyontime.com/" title="TimmyOnTime" target="_blank">TimmyOnTime</a>. TimmyOnTime is a time-management that uses instant messaging so you don&#8217;t forget to track your time. There are still places available for the alpha period. Please, give us some feedback.</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=tcXPb9"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=tcXPb9" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/06/26/ask-dan-friggin-libraries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A new project : TimmyOnTime</title>
		<link>http://www.javascriptkata.com/2007/06/14/a-new-project-timmyontime/</link>
		<comments>http://www.javascriptkata.com/2007/06/14/a-new-project-timmyontime/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 15:27:02 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[white belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=48</guid>
		<description><![CDATA[Some of you might know that I have worked with Frank Lamontagne of Ruby Fleebie on a project called Ecstatik!. That was the beginning of something.
Now, we are very pleased to announce you our new project : TimmyOnTime.
What is TimmyOnTime?
TimmyOnTime is a IM-based time management tool. To use it, you only need a Jabber client [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you might know that I have worked with Frank Lamontagne of <a href="http://www.rubyfleebie.com" target="_blank">Ruby Fleebie</a> on a project called <a href="http://www.ecstatik.com" target="_blank">Ecstatik!</a>. That was the beginning of something.</p>
<p>Now, we are very pleased to announce you our new project : TimmyOnTime.</p>
<h3>What is TimmyOnTime?</h3>
<p>TimmyOnTime is a <strong>IM-based time management tool</strong>. To use it, you only need a Jabber client like Google Talk or Gaim (MSN or AIM users don&#8217;t despair! We also added support for these 2 networks). To have Timmy track the time on your projects, you only have to chat with him via your IM! Let&#8217;s say for example you want to create the following new project : <em>Achieve hapiness</em>. Well, you just tell Timmy about it and you write : <em>create project achieve hapiness</em></p>
<p>Timmy will create your project and tell you if everything went OK in the process. Now that you have a project, you might want to create some tasks? Nothing is easier : <em>create task smile more often</em></p>
<p>At this point, Timmy have started the first session on your new task. To stop the timer, just write : <em>stop</em></p>
<h3>Web access is optional</h3>
<p>That&#8217;s right. One of the important thing for Frank and me was to make optional the web registration process. So, if you don&#8217;t want to bother about the website, just use your IM and chat with Timmy. However, we&#8217;re pretty sure you&#8217;ll want the added features of a web access (project / task renaming, time editing, etc).</p>
<h3>It&#8217;s your chance!</h3>
<p>We want to offer to RubyFleebie and JavascriptKata readers the chance to try this brand new application first. Since it is an Alpha release, we decided to limit to <strong>150</strong> the number of users that can access TimmyOnTime. If everything goes smoothly, we will increase that number slowly over time.</p>
<p>During this alpha period, we would appreciate that you give us feedback on the application. Also, if you find bugs, it would be nice that you let us know! ( contact@timmyontime.com )</p>
<p>To get you started : <a href="http://www.timmyontime.com">TimmyOnTime</a></p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=QMln9k"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=QMln9k" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/06/14/a-new-project-timmyontime/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ajax, javascript and threads : the final truth</title>
		<link>http://www.javascriptkata.com/2007/06/12/ajax-javascript-and-threads-the-final-truth/</link>
		<comments>http://www.javascriptkata.com/2007/06/12/ajax-javascript-and-threads-the-final-truth/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 14:44:38 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
		
		<category><![CDATA[ajax]]></category>

		<category><![CDATA[black belt]]></category>

		<guid isPermaLink="false">http://javascriptkata.timmyontime.com/?p=47</guid>
		<description><![CDATA[Since I have written Ajax and javascript donâ€™t use thread, one of my reader (BK) told me that I was wrong. Here&#8217;s the final truth.
What I said
If javascript runs some code that takes 5 seconds to execute and an ajax response arrives at 2 seconds, it will take 3 seconds before it will be executed [...]]]></description>
			<content:encoded><![CDATA[<p>Since I have written <a href="http://www.javascriptkata.com/2007/06/04/ajax-and-javascript-dont-use-threads/">Ajax and javascript donâ€™t use thread</a>, one of my reader (BK) told me that I was wrong. Here&#8217;s the final truth.</p>
<h3>What I said</h3>
<blockquote><p>If javascript runs some code that takes 5 seconds to execute and an ajax response arrives at 2 seconds, it will take 3 seconds before it will be executed (before the callback function is called).</p></blockquote>
<p>Example. We have a f() function that is incredibly long to execute (5 seconds) because it has a lot of code.</p>
<p>1. function f() is started<br />
2. f() makes an ajax call<br />
3. f() is still executing since 2 seconds<br />
4. the response from the server arrives at the third second<br />
5. f() is still in execution for 3 seconds<br />
6. the callback function for ajax is called</p>
<h3>What he said</h3>
<blockquote><p> Briefly, say I have CallPage1, CallPage2 and DoSomething. Both CallPage are async.</p>
<p>CallPage1 called<br />
CallPage2 called<br />
DoSomething called<br />
CallPage1 Returned (DoSomething is now paused)<br />
DoSomething ended<br />
CallPage2 Returned</p></blockquote>
<p>The DoSomething() function is paused when the ajax response arrives. The callback for the ajax is called and only then, DoSomething() resumes its execution.</p>
<p>That didn&#8217;t make sense to me. Javascript is really sequential and it would not do that kind of complex stuff. But, I had to be sure.</p>
<h3>The test</h3>
<p>I made a simple page to test it all.</p>
<p>1. Loop from 0 to X (user defined). X should be a big number.<br />
2. The first loop, it makes an ajax request<br />
3. The loops will finish someday<br />
4. The callback for the ajax will be called someday</p>
<p>I didn&#8217;t know what to expect : will the callback function be called <strong>before</strong> or <strong>after</strong> the loop?</p>
<h3>The result</h3>
<p>I ran <a href="http://www.javascriptkata.com/wp-content/uploads/test.php">the script</a> a lot of times with a lot of numbers and it was always the same thing : <strong>the callback function waits for the loop to be over before it is executed</strong>. It means that the current function is not paused.</p>
<h3>Now it&#8217;s your turn</h3>
<p>I want you to take a look at <a href="http://www.javascriptkata.com/wp-content/uploads/test.php">the script</a> (<a href="http://www.javascriptkata.com/wp-content/uploads/test.txt" target="_blank">complete php code</a>) (I know it&#8217;s poorly written, it&#8217;s just a test) and tell me if I&#8217;m wrong or if I&#8217;m right.</p>
<p>Thanks to you all!</p>

<p><a href="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?a=HQsPSK"><img src="http://feeds.feedburner.com/~a/javascriptkata/no_echo_chamber?i=HQsPSK" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptkata.com/2007/06/12/ajax-javascript-and-threads-the-final-truth/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
