<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dev 4 Web &#187; JavaScript</title>
	<atom:link href="http://nordz.sauleil.com/category/programming/js/feed/" rel="self" type="application/rss+xml" />
	<link>http://nordz.sauleil.com</link>
	<description>Just another Developer WordPress Discovery Channel</description>
	<lastBuildDate>Mon, 12 Apr 2010 08:17:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Regroup your JavaScript function using JSON</title>
		<link>http://nordz.sauleil.com/2008/11/19/regroup-your-javascript-function-using-json/</link>
		<comments>http://nordz.sauleil.com/2008/11/19/regroup-your-javascript-function-using-json/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 13:38:38 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=220</guid>
		<description><![CDATA[In JavaScript we have the opportunity to create object using JSON and we should use that opportunity for clarity of code. By example, if you want to have a call to a function that load something and return something else, you can do something like this:

var Math = &#123;
	Add: function&#40;Number1, Number2&#41; &#123;
		///
		///		Addition function.
		///
		/// Return the [...]]]></description>
			<content:encoded><![CDATA[<p>In JavaScript we have the opportunity to create object using JSON and we should use that opportunity for clarity of code. By example, if you want to have a call to a function that load something and return something else, you can do something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> Math <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	Add<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>Number1<span style="color: #339933;">,</span> Number2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">///		Addition function.</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">/// Return the total of two number (n1 + n2).</span>
&nbsp;
		Code here.
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	Sub<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>Number1<span style="color: #339933;">,</span> Number2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">///		Substract function.</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">/// Return the total of two number (n1 – n2).</span>
&nbsp;
		Code here.
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	...
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To call your function, you can simply call it by doing “alert(Math.Add(12,12));”. It is also possible to create object where you need to do a new to instantiate it.  To learn more about the JSON, you can go on http://msdn.microsoft.com/en-us/library/bb299886.aspx.<br />
If you want to instantiate an object that does some init stuff, I strongly suggest using something like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> Math <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#123;</span>
	init stuff here
	...
	<span style="color: #006600;">Create</span> <span style="color: #003366; font-weight: bold;">function</span> directly inside the <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>anonymous type<span style="color: #009900;">&#41;</span>
	<span style="color: #003366; font-weight: bold;">function</span> Sub<span style="color: #009900;">&#40;</span>Number1<span style="color: #339933;">,</span> Number2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">///		Substract function.</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">/// Return the total of two number (n1 – n2).</span>
&nbsp;
		Code here.
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> Math.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">Add</span> <span style="color: #009900;">&#40;</span>Number1<span style="color: #339933;">,</span> Number2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">///		Addition function.</span>
		<span style="color: #006600; font-style: italic;">///</span>
		<span style="color: #006600; font-style: italic;">/// Return the total of two number (n1 + n2).</span>
&nbsp;
		Code here.
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It actually looks more like a class that you need to instantiate. By example to use the previous code, you need to do:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> myMathObj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Math<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> addResult <span style="color: #339933;">=</span> myMathObj.<span style="color: #006600;">Add</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10</span><span style="color: #339933;">,</span><span style="color: #CC0000;">14</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> subResult <span style="color: #339933;">=</span> myMathObj.<span style="color: #006600;">Sub</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">15</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here’s a link to a good tutorial about the prototype: http://www.javascriptkit.com/javatutors/proto.shtml.</p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/11/19/regroup-your-javascript-function-using-json/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Visual Studio &#8211; compress automatically your js file when building</title>
		<link>http://nordz.sauleil.com/2008/11/16/visual-studio-compress-automatically-your-js-file-when-building/</link>
		<comments>http://nordz.sauleil.com/2008/11/16/visual-studio-compress-automatically-your-js-file-when-building/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 19:16:58 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=213</guid>
		<description><![CDATA[I found out that tiny-MCE (Moxie) was using one of their tool called JSTrim. That executable is used to compress your JavaScript files when you want and it also use an XML configuration file so you can select multiple JS files and put them together. By example, if you have 5 classes defined in 5 [...]]]></description>
			<content:encoded><![CDATA[<p>I found out that <a href="http://tinymce.moxiecode.com/">tiny-MCE (Moxie)</a> was using one of their tool called <a href="http://http://moxieforge.net/overview.php?project_id=10&amp;category_id=7">JSTrim</a>. That executable is used to compress your JavaScript files when you want and it also use an XML configuration file so you can select multiple JS files and put them together. By example, if you have 5 classes defined in 5 different JS files, you can create only one file having all those classes. You can even create a temporary files that contains those files and then compress it using a javascript compressor. That compressor remove all comments and stuff like that. You can actually choose if you want it compressed &#8220;high&#8221; or &#8220;low&#8221;.</p>
<p>When I work I actually have a source control (Team Foundation Server) application inside my Visual Studio 2008. I wanted to have some JavaScript file to be compressed when I was publishing my application on the web server. To do so, I actually added a new JavaScript file containing nothing to the solution under my script folder and I checked in my stuff. After that, I also added my JSTrim somewhere in the project with it&#8217;s config file.</p>
<p>After I went inside the project properties (right click on the project/properties). I went inside the build event (Post Build event command line) and added those lines:</p>

<div class="wp_syntax"><div class="code"><pre>cd $(SolutionDir)Web\Script\
attrib -r myCompiledJS.js
JSTrim.exe -m high --config JSTrim.config
attrib +r myCompiledJS.js</pre></div></div>

<p>The <strong>$(SolutionDir)</strong> is actually a system variable or macro, so that you can export those settings on different computer without having problems. The <strong>Web\Script\</strong> is the folder inside your solution where you can find your <strong>JSTrim.exe</strong>. The <strong>attrib -r myCompiledJS.js</strong> is actually a windows command line executable that allow you to remove the read-only and then put it back using the <strong>+r</strong> feature. Any Windows system or dos system should be able to run that line. Concerning the JSTrim possible attributes, I suggest you to do <strong>JSTrim -h</strong> to get all parameter information.</p>
<p>So, by adding those lines inside the post-build, whenever you have a successfull build, it will regenerate the compiled JavaScript file. What I personally do, I use the compiler current mode (debug, release, etc.) to use the proper JavaScript file. When I&#8217;m in debug mode, I always keep the non compiled JS files and when I publish or run as &#8220;Release&#8221; I use those compiled files. The major reason to do that is because you may want to debug your JavaScript more easily.</p>
<p>If you have any question, ask them <img src='http://nordz.sauleil.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/11/16/visual-studio-compress-automatically-your-js-file-when-building/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to resize IFrame to it&#8217;s content full height</title>
		<link>http://nordz.sauleil.com/2008/09/14/iframe-resize-to-its-content-full-height/</link>
		<comments>http://nordz.sauleil.com/2008/09/14/iframe-resize-to-its-content-full-height/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 14:52:56 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IFrame]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=177</guid>
		<description><![CDATA[When working with IFrame, we may want the frame taking the 100% height of its content. In fact, we want to simulate the IFrame to look like a DIV. It is not simple as setting height 100% and overflow none. 
The content of the IFrame content load after the current page is loaded or after [...]]]></description>
			<content:encoded><![CDATA[<p>When working with IFrame, we may want the frame taking the 100% height of its content. In fact, we want to simulate the IFrame to look like a DIV. It is not simple as setting height 100% and overflow none. </p>
<p>The content of the IFrame content load after the current page is loaded or after the &#8220;src&#8221; attribute change. So we are not able to have the IFrame content height or width until the data is rendered. It exist an event handler called &#8220;onload&#8221; that trigger once the content is loaded, but it is not possible to get the content body height, in fact it will alway&#8217;s return 0. By googling, I&#8217;ve found a lot of solutions, but none of them was working properly or at least working like I wanted. Because of that, I&#8217;ve written my own solution.</p>
<p>My solution is to use a &#8220;setTimeout&#8221; until the IFrame content is fully rendered on the page and after that, we are able to get the iframe content height and set it to the IFrame itself. In the following solution I actually use JQuery. If you need to convert it to normal JavaScript, it should be pretty easy.</p>
<p>Write this into your HTML:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre>&lt;iframe id=&quot;iframeId&quot; name=&quot;iframeId&quot; onload=&quot;sizeIFrame(this.id)<SEMI>&quot; style=&quot;width:100%<SEMI>&quot;&gt;
&lt;/iframe&gt;</pre></td></tr></table></div>

<p>Write this in your javascript (header or JS file):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> sizeIFrame<span style="color: #009900;">&#40;</span>frameId<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> myIFrame <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #339933;">+</span> frameId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> innerDoc <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>myIFrame.<span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">contentDocument</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> myIFrame.<span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">contentDocument</span> <span style="color: #339933;">:</span> myIFrame.<span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">contentWindow</span>.<span style="color: #006600;">document</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">// will throw an exception if the body is not fully loaded.</span>
		myIFrame.<span style="color: #006600;">height</span><span style="color: #009900;">&#40;</span>innerDoc.<span style="color: #006600;">body</span>.<span style="color: #006600;">scrollHeight</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">35</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>innerDoc.<span style="color: #006600;">body</span> <span style="color: #339933;">&amp;&amp;</span> innerDoc.<span style="color: #006600;">body</span>.<span style="color: #006600;">scrollHeight</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> sizeIFrame<span style="color: #009900;">&#40;</span>frameId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>If you are having any problem please leave a comment.</p>
<p>This solution have only been tested on Internet Explorer 6/7</p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/09/14/iframe-resize-to-its-content-full-height/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to use JavaScript setInterval / setTimeout that works in all browsers</title>
		<link>http://nordz.sauleil.com/2008/08/18/how-to-use-javascript-setinterval-settimeout-that-works-in-all-browsers/</link>
		<comments>http://nordz.sauleil.com/2008/08/18/how-to-use-javascript-setinterval-settimeout-that-works-in-all-browsers/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 23:29:05 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SetInterval]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=167</guid>
		<description><![CDATA[Like usual, inside Internet Explorer you have one way of doing it and inside other browser you have different way of doing it. In fact, they looks almost the same, but when it comes to send parameters to the function pointer in your interval you may have some troubles to be browser compliant.
Here&#8217;s how internet [...]]]></description>
			<content:encoded><![CDATA[<p>Like usual, inside Internet Explorer you have one way of doing it and inside other browser you have different way of doing it. In fact, they looks almost the same, but when it comes to send parameters to the function pointer in your interval you may have some troubles to be browser compliant.</p>
<p>Here&#8217;s how internet explorer define the <em>setInterval()</em> function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> iTimerID <span style="color: #339933;">=</span> window.<span style="color: #006600;">setInterval</span><span style="color: #009900;">&#40;</span>vCode<span style="color: #339933;">,</span> iMilliSeconds <span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> sLanguage<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>You can find how to work with it by going on the this site <a href="http://msdn.microsoft.com/en-us/library/ms536749(VS.85).aspx">msdn.microsoft.com</a>.</p>
<p>Inside Firefox, you can actually instead of the third parameter, submit 1 or more parameter that will be used when calling back your function. By going on <a href="http://developer.mozilla.org/en/docs/DOM:window.setInterval">Mozilla specification page</a>, you can find how to set interval on Mozilla browsers.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript">intervalID <span style="color: #339933;">=</span> window.<span style="color: #006600;">setInterval</span><span style="color: #009900;">&#40;</span>func<span style="color: #339933;">,</span> delay<span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> param1<span style="color: #339933;">,</span> param2<span style="color: #339933;">,</span> ...<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
intervalID <span style="color: #339933;">=</span> window.<span style="color: #006600;">setInterval</span><span style="color: #009900;">&#40;</span>code<span style="color: #339933;">,</span> delay<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Resolution</strong><br />
If you want to be able to send your function the proper parameter, the best way is be doing an inner function parameter calling the function you want to call. What does that mean? It means that you will be able to call a function using your context variables.</p>
<p>Here&#8217;s an example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> myIntervalId <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> myFunction<span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> b<span style="color: #339933;">,</span> c<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> xyz <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// some code</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Set the interval with an anonymous method calling your application method.</span>
	myIntervalId <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
			intervalFunction<span style="color: #009900;">&#40;</span>xyz<span style="color: #339933;">,</span> <span style="color: #CC0000;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> myIntervalId<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> intervalFunction<span style="color: #009900;">&#40;</span>param_1<span style="color: #339933;">,</span> param_2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>param_1 <span style="color: #339933;">!=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		clearInterval<span style="color: #009900;">&#40;</span>myIntervalId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Stop the interval</span>
		<span style="color: #006600; font-style: italic;">// some code here</span>
	<span style="color: #009900;">&#125;</span>
	param_1 <span style="color: #339933;">=</span> param_1 <span style="color: #CC0000;">-1</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// Some code here</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>param_1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
myFunction<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Do the call to a function;</span></pre></td></tr></table></div>

<p>In this small example with almost no code, you will actually wait 3 seconds and after it will stop the counter and do what you want to do. Also, between those interval, you will receive a pop-up saying how much time you have left before the countdown stop.</p>
<p>This is nothing extraordinary, but if you plan on using interval using context parameters, be aware that you should do this instead of anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/08/18/how-to-use-javascript-setinterval-settimeout-that-works-in-all-browsers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New plugin added on the site [HeartBeat]</title>
		<link>http://nordz.sauleil.com/2008/08/13/new-plugin-added-on-the-site-heartbeat/</link>
		<comments>http://nordz.sauleil.com/2008/08/13/new-plugin-added-on-the-site-heartbeat/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 00:19:28 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=129</guid>
		<description><![CDATA[I&#8217;ve created an another plugin that works on any html items. All you need to do is to do your selector and call my plugin &#8220;heartBeat&#8221;.
Example of doing a little animation with 3 divs (the 3 boxes under the code):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	$&#40;document&#41;.ready&#40;function&#40;&#41;&#123;
		$&#40;&#34;#beat1&#34;&#41;.heartBeat&#40;
			&#123;
			delayBetweenAnimation:2000,  
			delay:1000 
			&#125;&#41;;
		setTimeout&#40;function&#40;&#41;&#123;
			$&#40;&#34;#beat2&#34;&#41;.heartBeat&#40;
				&#123;
				delayBetweenAnimation:2000,  
				delay:1000 
				&#125;&#41;;
		&#125;, 200&#41;;
		setTimeout&#40;function&#40;&#41;&#123;
			$&#40;&#34;#beat3&#34;&#41;.heartBeat&#40;
				&#123;
				delayBetweenAnimation:2000,  
				delay:1000 
				&#125;&#41;;
		&#125;, 500&#41;;
	&#125;&#41;;







My 3 divs are made [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created an another plugin that works on any html items. All you need to do is to do your selector and call my plugin &#8220;heartBeat&#8221;.</p>
<p>Example of doing a little animation with 3 divs <span id="boxesInfo" style="color:darkred;">(the 3 boxes under the code)</span>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript">	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#beat1&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">heartBeat</span><span style="color: #009900;">&#40;</span>
			<span style="color: #009900;">&#123;</span>
			delayBetweenAnimation<span style="color: #339933;">:</span><span style="color: #CC0000;">2000</span><span style="color: #339933;">,</span>  
			delay<span style="color: #339933;">:</span><span style="color: #CC0000;">1000</span> 
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#beat2&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">heartBeat</span><span style="color: #009900;">&#40;</span>
				<span style="color: #009900;">&#123;</span>
				delayBetweenAnimation<span style="color: #339933;">:</span><span style="color: #CC0000;">2000</span><span style="color: #339933;">,</span>  
				delay<span style="color: #339933;">:</span><span style="color: #CC0000;">1000</span> 
				<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#beat3&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006600;">heartBeat</span><span style="color: #009900;">&#40;</span>
				<span style="color: #009900;">&#123;</span>
				delayBetweenAnimation<span style="color: #339933;">:</span><span style="color: #CC0000;">2000</span><span style="color: #339933;">,</span>  
				delay<span style="color: #339933;">:</span><span style="color: #CC0000;">1000</span> 
				<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div>
<div id="beat1" style="float:left;margin-left:5px;background-color:#AABBCC; width:10px; height:10px;"></div>
<div id="beat2" style="float:left;margin-left:5px;background-color:#AABBCC; width:20px; height:20px;"></div>
<div id="beat3" style="float:left;margin-left:5px;background-color:#AABBCC; width:30px; height:30px;"></div>
</div>
<p><br/><br />
My 3 divs are made like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;beat1&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;float:left;margin-left:5px;background-color:#AABBCC; width:10px; height:10px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;beat2&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;float:left;margin-left:5px;background-color:#AABBCC; width:20px; height:20px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;beat3&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;float:left;margin-left:5px;background-color:#AABBCC; width:30px; height:30px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></pre></td></tr></table></div>

<p>Note that, you can use class or whatever you want inside the selector instead of the id (I recommend it).</p>
<p><a href="http://nordz.sauleil.com/downloads/JQuery-heartBeat.zip">Heart Beat 0.1</a><br />
<script type="text/JavaScript">
	$(document).ready(function(){
		$("#beat1, #boxesInfo").heartBeat(
			{
			delayBetweenAnimation:2000,  
			delay:1000 
			});
		setTimeout(function(){
			$("#beat2").heartBeat(
				{
				delayBetweenAnimation:2000,  
				delay:1000 
				});
		}, 200);
		setTimeout(function(){
			$("#beat3").heartBeat(
				{
				delayBetweenAnimation:2000,  
				delay:1000 
				});
		}, 500);
	});
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/08/13/new-plugin-added-on-the-site-heartbeat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JQuery &#8211; checkboxMod plugins is now available</title>
		<link>http://nordz.sauleil.com/2008/08/11/jquery-checkboxmod-plugins-is-now-available/</link>
		<comments>http://nordz.sauleil.com/2008/08/11/jquery-checkboxmod-plugins-is-now-available/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 11:49:50 +0000</pubDate>
		<dc:creator>Nordes</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://nordz.sauleil.com/?p=89</guid>
		<description><![CDATA[My first JQuery plugin is now available to everyone. I also added the plugin into the JQuery plugins site. To access this plugin you only have to click here.
Description:
This plugin is used to enhence the actual checkbox in pages. Depending on OS and Theme, people actually have different check box look and feel. The one [...]]]></description>
			<content:encoded><![CDATA[<p>My first JQuery plugin is now available to everyone. I also added the plugin into the JQuery plugins site. To access this plugin you only have to click <a href="http://nordz.sauleil.com/jquery-plugins/downloads/">here</a>.</p>
<p><strong>Description:</strong><br />
This plugin is used to enhence the actual checkbox in pages. Depending on OS and Theme, people actually have different check box look and feel. The one in Windows XP is actually looking good, but compared to Vista, Vista is even more beautiful. I wanted to create a more standard check box that you can use everywhere (code behind, etc.).</p>
<p>Sample:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#cbwt1&quot;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #006600;">CheckboxMod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
      ImageUrlChecked<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://nordz.sauleil.com/wp-includes/images/nordz/CBMod/checked.jpg'</span><span style="color: #339933;">,</span> 
      ImageUrlUnchecked<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://nordz.sauleil.com/wp-includes/images/nordz/CBMod/unchecked.jpg'</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<input id="cbwt1" type="checkbox" /><label for="cbwt1">Click me</label> : This is a checkbox rendered using checkboxMod plugin. </p>
<p>To know more about that plugin, you can go in JQuery Plugins section.<br />
<script>
$(document).ready(function(){
 $("#cbwt1")
  .CheckboxMod({ImageUrlChecked: 'http://nordz.sauleil.com/wp-includes/images/nordz/CBMod/checked.jpg', ImageUrlUnchecked: 'http://nordz.sauleil.com/wp-includes/images/nordz/CBMod/unchecked.jpg'});
});
</script></p>
<p><a href="http://nordz.sauleil.com/downloads/JQuery-checkboxMod.zip">Download Checkbox Modfier Version 0.2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nordz.sauleil.com/2008/08/11/jquery-checkboxmod-plugins-is-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
