<?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>TutorBoy Articles &#187; Javascript</title>
	<atom:link href="http://articles.tutorboy.com/topics/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://articles.tutorboy.com</link>
	<description>Online Complete Reference</description>
	<lastBuildDate>Thu, 09 Sep 2010 09:53:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Detect iPod, iPad and iPhone Using JavaScript</title>
		<link>http://articles.tutorboy.com/javascript/detect-ipod-ipad-iphone-using-javascript.html</link>
		<comments>http://articles.tutorboy.com/javascript/detect-ipod-ipad-iphone-using-javascript.html#comments</comments>
		<pubDate>Wed, 08 Sep 2010 11:54:09 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Js]]></category>

		<guid isPermaLink="false">http://articles.tutorboy.com/?p=2401</guid>
		<description><![CDATA[JavaScript code to detect the user-agents of iPhone, iPad or iPod. if (/iPad&#124;iPod&#124;iPhone/.test(navigator.userAgent)){ // do ur stuffs for apple }else{ // do ur stuffs for other browsers }]]></description>
			<content:encoded><![CDATA[<p>JavaScript code to detect the user-agents of iPhone, iPad or iPod.</p>
<pre class="brush:js">if (/iPad|iPod|iPhone/.test(navigator.userAgent)){
	// do ur stuffs for apple
}else{
	// do ur stuffs for other browsers
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/detect-ipod-ipad-iphone-using-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Include js files inside a js file</title>
		<link>http://articles.tutorboy.com/javascript/include-js-files-inside-a-js-file.html</link>
		<comments>http://articles.tutorboy.com/javascript/include-js-files-inside-a-js-file.html#comments</comments>
		<pubDate>Mon, 06 Sep 2010 05:50:14 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Js]]></category>

		<guid isPermaLink="false">http://articles.tutorboy.com/?p=2383</guid>
		<description><![CDATA[Some times you want to include or load other .js files inside another .js files or on document. JavaScript doesn&#8217;t have any function to include any external js files. Writing script tag each time to DOM is not a good &#8230; <a href="http://articles.tutorboy.com/javascript/include-js-files-inside-a-js-file.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some times you want to include or load other .js files inside another .js files or on document. JavaScript doesn&#8217;t have any function to <code>include </code>any external js files. Writing script tag each time to DOM is not a good practice. Here the solution to load the script tag inside the head.<span id="more-2383"></span></p>
<h2>JavaScript</h2>
<pre class="brush:js">var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'externalScriptFile.js';
document.getElementsByTagName("head")[0].appendChild(script);
</pre>
<p>Use the above JavaScript code inside your body or .js file. The <code>script.src</code> is the file name which you want to load and the script will append to the <code>head</code> tag. If you have to load more files like this, just copy paste this into a function body.</p>
<h2>JavaScript</h2>
<pre class="brush:js">function include(jsFile) {
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.src = jsFile;
	document.getElementsByTagName("head")[0].appendChild(script);
}
include('externalScriptFile1.js');
include('externalScriptFile2.js');
</pre>
<p><strong>W</strong>ell you are done with that, now just read something about the <code>script </code>tag in <code>HTML</code>. The script tag is used to load or run scripts HTML, we use mainly 3 attributes for the script. No need to use the commenting(&lt;!&#8211; //&#8211;&gt;) tags inside the script tag, that is for the first generation browsers <img src='http://articles.tutorboy.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  to prevent scripts from showing up as text.</p>
<p>Script tag to load the script file</p>
<pre class="brush:js">&lt;script src="filename.js" type="text/javascript"&gt;&lt;/script&gt;
</pre>
<p>You should not write any codes inside the script tags when its use to load any file(s). Because if the <code>src</code> is present the script tag will considered as a load process. So any script inside that will not execute. But you can use the script with-out <code>src</code> will help you to execute the script.<br />
Script tag to execute the script</p>
<pre class="brush:js">&lt;script type="text/javascript"&gt;document.write("Hello World!!!");&lt;/script&gt;
</pre>
<h2>Attributes</h2>
<p><strong>src </strong>:  This attribute specifies the location of an external script.<br />
<strong>type </strong>:  This attribute specifies the scripting language of the element&#8217;s contents and overrides<br />
the default scripting language. The scripting language is specified as a content type<br />
(e.g., &#8220;text/javascript&#8221;). Authors must supply a value for this attribute.<br />
There is no default value for this attribute.<br />
<strong>defer </strong>:  When set, this boolean attribute provides a hint to the user agent that the script<br />
is not going to generate any document content (e.g., no &#8220;document.write&#8221; in javascript)<br />
and thus, the user agent can continue parsing and rendering.<br />
<strong>language </strong>: This attribute specifies the scripting language of the contents of this element.<br />
Its value is an identifier for the language, but since these identifiers are<br />
not standard, this attribute has been <em><strong>deprecated </strong></em>in favor of type.<br />
Reference: <a href="http://www.w3.org/TR/REC-html40/interact/scripts.html" target="_blank">http://www.w3.org/TR/REC-html40/interact/scripts.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/include-js-files-inside-a-js-file.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Vertical Floating Menu With Accordion Effect Using CSS &amp; jQuery</title>
		<link>http://articles.tutorboy.com/javascript/vertical-floating-menu-with-accordion-effect-using-css-jquery.html</link>
		<comments>http://articles.tutorboy.com/javascript/vertical-floating-menu-with-accordion-effect-using-css-jquery.html#comments</comments>
		<pubDate>Wed, 23 Jun 2010 01:55:13 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Accordion Menu]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Floating Menu]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript Menu]]></category>
		<category><![CDATA[Jquery Menu]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://articles.tutorboy.com/?p=1816</guid>
		<description><![CDATA[It is a combination of 3 types of menu styles, Floating, Sliding and Accordion with the css and jQuery.  The menu will appear in the screen as a floating menu, on mouse over the menu will slide(visible) from left to &#8230; <a href="http://articles.tutorboy.com/javascript/vertical-floating-menu-with-accordion-effect-using-css-jquery.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It is a combination of 3 types of menu styles, Floating, <a href="http://articles.tutorboy.com/content/uploads/2010/06/Menu-After-Slide.png"><img class="size-full wp-image-1826 alignright" style="margin: -5px 5px;" title="Menu After Slide" src="http://articles.tutorboy.com/content/uploads/2010/06/Menu-After-Slide.png" alt="" width="308" height="183" /></a>Sliding and Accordion with the css and jQuery.  The menu will appear in the screen as a floating menu, on mouse over the menu will slide(visible) from left to outside. And on mouse out event the menu will slide to left. On the menu you can click on each item, and the sub-entries will shown with an animated effect. While window scrolling the menu will hide to left-side and floating on the same position.<a href="http://articles.tutorboy.com/content/uploads/2010/06/Menu-Before-Expand.png"><img class="size-full wp-image-1825 alignleft" style="margin-left: 0px; margin-right: 5px;" title="Menu Before Expand" src="http://articles.tutorboy.com/content/uploads/2010/06/Menu-Before-Expand.png" alt="" width="308" height="107" /></a><span id="more-1816"></span>The two level  menu style is done with nested  ul, li elements.</p>
<p><a class="wp-caption" title="Download the source code" href="http://downloads.tutorboy.com/articles/Floating_Accordion_sliding_menu.zip">Download</a> <a class="wp-caption" title="View Demo" href="http://articles.tutorboy.com/content/Floating_Accordion_sliding_menu/">Demo</a></p>
<h2>HTML</h2>
<pre class="brush:html">&lt;div id="floating"&gt;
 &lt;div id="accordionMenu"&gt;
 &lt;ul id="accordion"&gt;
 &lt;li&gt;
 &lt;a href="#"&gt;Recent Posts&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;
 &lt;a href="#"&gt;Archives&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 4&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 5&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;Link 6&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;/ul&gt;
 &lt;/div&gt;
 &lt;div id="closeOpen"&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>The above html is the layout of the UL li list. Replace with your content.</p>
<h2>CSS</h2>
<pre class="brush:css">body {padding:0;margin:0;height:2000px;}
#floating {position:absolute;top:150px;font-size:.9em;}
#floating a {color:#FFF;text-decoration:none;}
#accordionMenu {width: 300px;}
#closeOpen {float:right;width:18px;}
#accordion {border:1px #666 solid;background-color:#DDD;margin-top:0;padding:0;float:left;list-style: none;width: 280px;}
#accordion ul {list-style: none;padding:0;display: none;}
#accordion li{cursor: pointer;padding:3px;list-style:none;font-weight:bold;background-color:#36A8FF;}
#accordion li ul li a{font-style:italic;}
#accordion li ul li{border-top:1px #666666 solid;}
#accordion li ul li:hover{background-color:#c0c0c0;}
#accordion li ul {display: none;}
#accordion li.current ul{display:block;}
#accordion .current ul{padding-left:10px;}</pre>
<h2>HTML Header</h2>
<pre class="brush:html">&lt;head&gt;
 &lt;script type="text/javascript" src="jquery-latest.min.js"&gt;&lt;/script&gt;
 &lt;script type="text/javascript" src="jquery.scrollTo-min.js"&gt;&lt;/script&gt;
 &lt;link type="text/css" rel="stylesheet" href="style.css"/&gt;
&lt;/head&gt;</pre>
<p>You need to download the latest jQuery and <em><strong><a title="Plugins | jQuery Plugins" href="http://plugins.jquery.com/project/ScrollTo">scrollTo plugin</a>. </strong></em></p>
<h2>jQuery Script</h2>
<pre class="brush:js">&lt;script type="text/javascript"&gt;
 var menuIconWidth = 20;
 var topMargin = null;
 var openImage = '&lt;img src="right.png" alt="open" /&gt;';
 var closeImage = '&lt;img src="left.png" alt="close" /&gt;';
 // floating div id
 var floatingDiv = "#floating";
 // accordion menu div id
 var accordionDiv = "#accordion";

 $(document).ready(function () {
 $("#closeOpen").html(openImage);
 topMargin = parseInt($(floatingDiv).css("top").substring(0,$(floatingDiv).css("top").indexOf("px")))
 $(floatingDiv).css({left: menuIconWidth - $(floatingDiv).width()});
 // for floating menu
 $(floatingDiv).mouseenter(function () {
 // show menu
 $(this).stop().animate({left:  0}, "slow");
 $("#closeOpen").html(closeImage);
 }).mouseleave (function () {
 // hide menu
 $(this).stop().animate({left: menuIconWidth - $(this).width()}, "slow");
 $("#closeOpen").html(openImage);
 });
 // handle the scroll event of the window.
 $(window).scroll(function () {
 // calculate the offset of the page scroll and animate the div for the floating effect.
 var offset = topMargin + $(document).scrollTop() + "px";
 $(floatingDiv).animate({top:offset}, {duration:500, queue:false});
 });

 // for According Menu
 $(accordionDiv + ' &gt; li a').click(function() {
 if($(this).parent().hasClass('current')) {
 $(this).siblings('ul').slideUp(300,function() {
 $(this).parent().removeClass('current');
 $.scrollTo(accordionDiv,300);
 });
 } else {
 $(accordionDiv + ' li.current ul').slideUp(300, function() {
 $(this).parent().removeClass('current');
 });
 $(this).siblings('ul').slideToggle(300, function() {
 $(this).parent().toggleClass('current');
 });
 $.scrollTo(accordionDiv, 300);
 }
 return false;
 });

 });
 &lt;/script&gt;</pre>
<p>In the above jQuery the floating and accordion are write separately, so you can disable a feature easily. <img src='http://articles.tutorboy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="wp-caption" title="Download the source code" href="http://downloads.tutorboy.com/articles/Floating_Accordion_sliding_menu.zip">Download</a> <a class="wp-caption" title="View Demo" href="http://articles.tutorboy.com/content/Floating_Accordion_sliding_menu/">Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/vertical-floating-menu-with-accordion-effect-using-css-jquery.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Common Escape Sequences</title>
		<link>http://articles.tutorboy.com/javascript/javascript-common-escape-sequences.html</link>
		<comments>http://articles.tutorboy.com/javascript/javascript-common-escape-sequences.html#comments</comments>
		<pubDate>Sat, 19 Jun 2010 18:16:49 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://articles.tutorboy.com/?p=1804</guid>
		<description><![CDATA[It’s better coding practice to use escape sequences, because they make your code easier to read. Escape sequences are also useful for situations where you want to use characters that can’t be typed using a keyboard. Escape Sequences Character Represented &#8230; <a href="http://articles.tutorboy.com/javascript/javascript-common-escape-sequences.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It’s better coding practice to use escape sequences, because they make your code easier to read. Escape sequences are also useful for situations where you want to use characters that can’t be typed using a keyboard.<span id="more-1804"></span></p>
<table border="0" cellpadding="2" width="100%">
<thead>
<th>Escape Sequences</th>
<th>Character Represented</th>
</thead>
<tbody>
<tr>
<td>\b</td>
<td>Backspace.</td>
</tr>
<tr>
<td>\f</td>
<td>Form feed.</td>
</tr>
<tr>
<td>\n</td>
<td>Newline.</td>
</tr>
<tr>
<td>\t</td>
<td>Tab.</td>
</tr>
<tr>
<td>\&#8217;</td>
<td>Single quote.</td>
</tr>
<tr>
<td>\&#8221;</td>
<td>Double quote.</td>
</tr>
<tr>
<td>\\</td>
<td>Backslash.</td>
</tr>
<tr>
<td>\xNN</td>
<td>NN is a hexadecimal number that identifies a character in the Latin-1<br />
character set (the Latin-1 character is the norm for English-speaking<br />
countries).</p>
<pre class="brush:js">document.write( "\x40 is @" );</pre>
</td>
</tr>
<tr>
<td>\uDDDD</td>
<td>DDDD is a hexadecimal number identifying a Unicode character.</p>
<pre class="brush:js">document.write( "\u00AE is ®" );
</pre>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/javascript-common-escape-sequences.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: The Good Parts &#8211; Speaker: Douglas Crockford</title>
		<link>http://articles.tutorboy.com/javascript/javascript-the-good-parts-speaker-douglas-crockford.html</link>
		<comments>http://articles.tutorboy.com/javascript/javascript-the-good-parts-speaker-douglas-crockford.html#comments</comments>
		<pubDate>Thu, 06 May 2010 11:44:25 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Js]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1583</guid>
		<description><![CDATA[JavaScript is a language with more than its share of bad parts. It went from non-existence to global adoption in an alarmingly short period of time. It never had an interval in the lab when it could be tried out &#8230; <a href="http://articles.tutorboy.com/javascript/javascript-the-good-parts-speaker-douglas-crockford.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>JavaScript is a language with more than its share of bad parts. It went from non-existence to global adoption in an alarmingly short period of time. It never had an interval in the lab when it could be tried out and polished. JavaScript has some extraordinarily good parts. In JavaScript there is a beautiful, highly expressive language that is buried under a steaming pile of good intentions and blunders. The best nature of JavaScript was so effectively hidden that for many years the prevailing opinion of JavaScript was that it was an unsightly, incompetent abomination. This session will expose the goodness in JavaScript, an outstanding dynamic programming language. Within the language is an elegant subset that is vastly superior to the language as a whole, being more reliable, readable and maintainable.<span id="more-1583"></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="505" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/hQVTIJBZook&amp;hl=en_US&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="505" src="http://www.youtube.com/v/hQVTIJBZook&amp;hl=en_US&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Speaker: Douglas Crockford<br />
Douglas Crockford is a product of our public education system. A registered voter, he owns his own car. He has developed office automation systems. He did research in games and music at Atari. He was Director of Technology at Lucasfilm. He was Director of New Media at Paramount. He was the founder and CEO of Electric Communities/Communities.com. He was founder and CTO of State Software, where he discovered JSON. He is interested in Blissymbolics, a graphical, symbolic language. He is developing a secure programming language. He is now an architect at Yahoo! and the world&#8217;s foremost living authority on JavaScript.</p>
<p>The PDF version is available in <a href="http://www.amazon.com/dp/0596517742">http://www.amazon.com/dp/0596517742</a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/javascript-the-good-parts-speaker-douglas-crockford.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MooTools as a General Purpose Application Framework</title>
		<link>http://articles.tutorboy.com/javascript/mootools-as-a-general-purpose-application-framework.html</link>
		<comments>http://articles.tutorboy.com/javascript/mootools-as-a-general-purpose-application-framework.html#comments</comments>
		<pubDate>Mon, 03 May 2010 06:36:52 +0000</pubDate>
		<dc:creator>midhund</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1577</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/6nOVQDMOvvE&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/6nOVQDMOvvE&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/mootools-as-a-general-purpose-application-framework.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Common methods for indicating important comments</title>
		<link>http://articles.tutorboy.com/flash/common-methods-for-indicating-important-comments.html</link>
		<comments>http://articles.tutorboy.com/flash/common-methods-for-indicating-important-comments.html#comments</comments>
		<pubDate>Sat, 24 Apr 2010 13:27:49 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Action Script 2.0]]></category>
		<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1533</guid>
		<description><![CDATA[Some common methods for indicating important comments are TODO, BUG, KLUDGE and TRICKY. You can try this in any language, I&#8217;m using this in Action Script, PHP, Flex and Javascript and CSS also . 1 . // :TODO: Description Indicates &#8230; <a href="http://articles.tutorboy.com/flash/common-methods-for-indicating-important-comments.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some common methods for indicating important comments are TODO, BUG, KLUDGE and TRICKY. You can try this in any language, I&#8217;m using this in Action Script, PHP, Flex and Javascript and CSS also <img src='http://articles.tutorboy.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  .</p>
<p>1 . <strong>// :TODO: </strong> <em>Description</em><br />
Indicates that there is more to do here.<span id="more-1533"></span><br />
2. <strong>// :BUG: [bugid] </strong><em>Description</em><br />
Shows a known issue here. The comment should also explain the issue and optionally give a bug ID if applicable.<br />
3. <strong>// :KLUDGE:</strong> <em>Description</em><br />
Indicates that the following code is not elegant or does not conform to best practices. This comment alerts others to provide suggestions about how to code it differently next time.<br />
4. <strong>// :TRICKY:</strong> <em>Description</em><br />
Notifies developers that the subsequent code has a lot of interactions. Also advises developers that they should think twice before trying to modify it.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/flash/common-methods-for-indicating-important-comments.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Orkut Style Profile Picture Upload Using jQuery and Ajaxupload</title>
		<link>http://articles.tutorboy.com/javascript/orkut-style-profile-picture-upload-using-jquery-and-ajaxupload.html</link>
		<comments>http://articles.tutorboy.com/javascript/orkut-style-profile-picture-upload-using-jquery-and-ajaxupload.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:42:40 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1467</guid>
		<description><![CDATA[We can&#8217;t apply any style over the html file element. But with the help of jQuery and Ajaxupload plugins we can style the file element.  And another alternative solution is to create a file button in Flash. I prefer JavaScript &#8230; <a href="http://articles.tutorboy.com/javascript/orkut-style-profile-picture-upload-using-jquery-and-ajaxupload.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://articles.tutorboy.com/content/uploads/2010/03/orkut_profile_pic.jpg"><img class="alignright size-full wp-image-1469" style="margin: 10px;" title="orkut_profile_pic" src="http://articles.tutorboy.com/content/uploads/2010/03/orkut_profile_pic.jpg" alt="" /></a>We can&#8217;t apply any style over the html <strong><em>file element</em></strong>. But with the help of jQuery and Ajaxupload plugins we can style the <em><strong>file element</strong></em>.  And another alternative solution is to create a <em><strong>file</strong></em> button in Flash. I prefer JavaScript method because its more efficient than flash. Orkut implemented such things in picture uploading section. So I tried to adopt the same style of photo upload from Orkut&#8217;s new theme.</p>
<h3><a class="wp-caption" title="View Demo" href="http://articles.tutorboy.com/content/fileupload/changeImage.php" target="_blank">Vew Demo</a> <a class="wp-caption" href="http://downloads.tutorboy.com/articles/fileupload.zip" target="_blank">Download</a></h3>
<p>In my example, I used the JQuery and Ajaxupload plugin for the development. You can customize this easily. Image replacement with out refreshing your page.</p>
<p><span id="more-1467"></span>Download the <a href="http://docs.jquery.com/Downloading_jQuery" target="_blank">jQuery </a>&amp; <a href="http://valums.com/ajax-upload/" target="_blank">Ajaxupload </a>Js files from the site.</p>
<p>1. Put the jQuery and Ajaxupload into a folder called js or something, and include that in the HTML page.</p>
<h2>HTML:</h2>
<pre class="brush:html">&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/ajaxupload.js"&gt;&lt;/script&gt;</pre>
<p>2. Create the image container and other related div and style. Here I have one main DIV called <em>profile_pic </em>and inside that a div with img element having the spinner icon, which is invisible at the first and will active while uploading. Then one more image element for the profile picture. Next is the &#8220;change my photo&#8221; button div.</p>
<h2>HTML:</h2>
<pre class="brush:html">&lt;body&gt;
 &lt;!-- // Container --&gt;
 &lt;div class='profile_pic'&gt;
 &lt;!-- // Spinner --&gt;
 &lt;div id="spinner" style="display:none"&gt;
 &lt;img src="spinner_large.gif" border="0"&gt;
 &lt;/div&gt;
 &lt;!-- // Profile picture --&gt;
 &lt;img src='ep.jpg'  id="profile_img" /&gt;
 &lt;!-- // Button Container --&gt;
 &lt;div class='change_button' id='change_button'&gt;
 &lt;!-- // Button --&gt;
 &lt;div class='change_button_text'&gt;Change my photo&lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
&lt;/body&gt;</pre>
<p>3. Next is to style the container and other img tags for the better effect with the help of jQuery. Put the following css codes inside the &lt;head&gt; tag.</p>
<h2>CSS:</h2>
<pre class="brush:css">&lt;style type="text/css"&gt;
 div.profile_pic{
 position:relative;
 width:125px;
 }
 div.change_button{
 position:absolute;
 bottom:0px;
 left:0px;
 display:none;
 background-color:black;
 font-family: 'tahoma';
 font-size:11px;
 text-decoration:underline;
 color:white;
 width:125px;
 }
 div.change_button_text{
 padding:10px;
 }
 #spinner{
 position:absolute;
 }
&lt;/style&gt;</pre>
<p>4. Write the JavaScript to enable  <em><strong>file</strong></em> element activities.  There is no physical existence for the <em><strong>file</strong></em> element. But we create this with the help of Ajaxupload plugin.</p>
<h2>JS for  fadein fadeout effect</h2>
<pre class="brush:js">&lt;script type="text/javascript"&gt;
$(window).load(function(){
 // Store the button instance
 var button = $('#change_button');
 // Store the spinner image instance
 var spinner = $('#spinner');

 // Set the opacity to 0...
 button.css('opacity', 0);
 // Set the spinner position as the middle of the profile picture.
 spinner.css('top', ($('.profile_pic').height() - spinner.height()) / 2)
 spinner.css('left', ($('.profile_pic').width() - spinner.width()) / 2)

 // On mouse over those thumbnail
 $('.profile_pic').hover(function() {
 button.css('opacity', .5);
 button.stop(false,true).fadeIn(200);
 },
 function() {
 button.stop(false,true).fadeOut(200);
 });</pre>
<h2>JS for File Element</h2>
<pre class="brush:js">new AjaxUpload(button,{
 action: 'upload.php', // Action page
 name: 'myfile', // file element name
 onSubmit : function(file, ext){
 // Show the spinner while onsubmit
 spinner.css('display', 'block');
 // Yyou can disable upload button
 this.disable();
 },
 // In 'response' variable you will get the value from the upload.php
 onComplete: function(file, response){
 // Set the fadeout value.
 button.stop(false,true).fadeOut(200);
 // remove the Spinner after the upload.
 spinner.css('display', 'none');
 // Assign the new image as the profile picture.
 $('#profile_img').attr('src', response);
 // Enable upload button
 this.enable();
 }
 });

});
&lt;/script&gt;</pre>
<p>5. From the above AjaxUplaod function you can see the action file path &#8220;upload.php&#8221; and &#8220;myfile&#8221; is the file element name. You will get the in php by<strong> $_FILES['myfile']. </strong>The php file should return the image path of the uploaded image.  and the javascipt will receive the name in <strong>response </strong>variable.</p>
<h2>Upload.php</h2>
<pre class="brush:php">&lt;?php
 // Set the upload folder path
 $target_path = "uploads/";
 // Set the new path with the file name
 $target_path = $target_path . basename( $_FILES['myfile']['name']); 

 // Move the file to the upload folder
 if(move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
 /*print the new image path in the page, and this will recevie the javascripts 'response' variable
You can add the resize and other image function here. */
 echo $target_path;
 } else{
 // Set default the image path if any error in upload.
 echo "default.jpg";
 }

?&gt;</pre>
<p>Now its ready to use.</p>
<h2><a class="wp-caption" href="http://articles.tutorboy.com/content/fileupload/changeImage.php" target="_blank">View Demo</a> <a class="wp-caption" href="http://downloads.tutorboy.com/articles/fileupload.zip" target="_blank">Download</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/orkut-style-profile-picture-upload-using-jquery-and-ajaxupload.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating a simple fade over effect &#8211; JQuery</title>
		<link>http://articles.tutorboy.com/javascript/creating-a-simple-fade-over-effect-jquery.html</link>
		<comments>http://articles.tutorboy.com/javascript/creating-a-simple-fade-over-effect-jquery.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 12:48:20 +0000</pubDate>
		<dc:creator>Sreejith Sreedharan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1428</guid>
		<description><![CDATA[Here , i will tell you how to add a fade over /fade in effect to image button in jquery. its very simple&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 1. Import jquery &#60;script type='text/javascript' src='http://yoursite.com/jquery.js'&#62;&#60;/script&#62; 2. Add a div tag with image in it &#60;div class="fadeDiv"&#62; &#8230; <a href="http://articles.tutorboy.com/javascript/creating-a-simple-fade-over-effect-jquery.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here , i will tell you how to add a fade over /fade in effect to image button in jquery. its very simple&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<h2>1. Import jquery</h2>
<pre class="brush:js">&lt;script type='text/javascript' src='http://yoursite.com/jquery.js'&gt;&lt;/script&gt;</pre>
<h2>2. Add a div tag with image in it</h2>
<pre class="brush:html">&lt;div class="fadeDiv"&gt;
    &lt;img src="1jpg" alt="" /&gt;
    &lt;img src="2.jpg" alt="" /&gt;
&lt;/div&gt;<span id="more-1428"></span></pre>
<h2>3 .  Add script Jquery on load</h2>
<pre class="brush:js">$(document).ready(function(){
 $("img").hover(
 function() {
 $(this).animate({"opacity": "0"}, "slow");
 },
 function() {
 $(this).animate({"opacity": "1"}, "slow");
 }
 );
});</pre>
<p>That&#8217;s it . you can now see the fade in and fade out effect on mouse over the button<br />
you can change the js to add more functionalites.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/creating-a-simple-fade-over-effect-jquery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>document.all vs document.getElementById</title>
		<link>http://articles.tutorboy.com/javascript/document-all-vs-document-getelementbyid.html</link>
		<comments>http://articles.tutorboy.com/javascript/document-all-vs-document-getelementbyid.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:16:40 +0000</pubDate>
		<dc:creator>Midhun Devasia</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://tutorboy.com/articles/?p=1418</guid>
		<description><![CDATA[document.all() -  is a non-standard way of accessing DOM elements. It was introduced in Internet Explorer 4, because the W3C DOM hadn’t yet standardised a way of grabbing references to elements using their ID. By the time IE 5 came out, &#8230; <a href="http://articles.tutorboy.com/javascript/document-all-vs-document-getelementbyid.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>document.all()</strong> -  is a non-standard way of accessing DOM elements. It was introduced in Internet Explorer 4, because the <acronym title="World Wide Web Consortium">W3C</acronym> <acronym title="Document Object Model">DOM</acronym> hadn’t yet standardised a way of grabbing references to elements using their ID. By the time <acronym title="Internet Explorer">IE</acronym> 5 came out, document.getElementById() had been standardised and as a result, <acronym title="Internet Explorer">IE</acronym> 5 included support for it.<br />
<strong>document.getElementById()</strong> -  is a standard and fully supported. Each element have a unique id on the document. It is supported by every Javascript supporting browser released since 1998.</p>
<p>Or you can use:<span id="more-1418"></span></p>
<h2>JavaScript</h2>
<pre class="brush:javascript">if(document.getElementById){  //DOM
  element = document.getElementById(id);
}
else if (document.all) {  //IE
  element = document.all[id];
}
else if (document.layers){  //Netscape &lt; 6
  element = document.layers[id];
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://articles.tutorboy.com/javascript/document-all-vs-document-getelementbyid.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
