<?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>bugs of a debugger &#187; java script</title>
	<atom:link href="http://arunmvishnu.com/tag/java-script/feed" rel="self" type="application/rss+xml" />
	<link>http://arunmvishnu.com</link>
	<description>itz all about me, my works, my views, my feelings …. all my bla bla blas</description>
	<lastBuildDate>Sat, 03 Dec 2011 16:49:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Font resizing using jQuery</title>
		<link>http://arunmvishnu.com/programming/javascript/font-resizing-using-jquery.html</link>
		<comments>http://arunmvishnu.com/programming/javascript/font-resizing-using-jquery.html#comments</comments>
		<pubDate>Wed, 15 Apr 2009 17:46:30 +0000</pubDate>
		<dc:creator>Arun Vishnu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://arunmvishnu.com/?p=552</guid>
		<description><![CDATA[Font Resizing is a very common feature in many modern websites. This can be done very easily with jQuery. The following script uses cookies to save the user preference, so the user preference is saved. jQuery Cookie plugin is used for managing cookie using jQuery. So include that too. the html for increase, decrease links &#60;div&#62; &#60;a href=&#34;javascript:void decreaseFont();&#34; class=&#34;font-smaller&#34; title=&#34;Reduce font size&#34;&#62;-&#60;/a&#62; &#60;a href=&#34;javascript:void normalFont();&#34; class=&#34;font-normal&#34; title=&#34;Normal font size&#34;&#62;0&#60;/a&#62; &#60;a href=&#34;javascript:void increaseFont();&#34; class=&#34;font-bigger&#34; title=&#34;Increase [...]]]></description>
			<content:encoded><![CDATA[<p>Font Resizing is a very common feature in many modern websites. This can be done very easily with <a href="http://jquery.com/">jQuery</a>. The following script uses cookies to save the user preference, so the user preference is saved. <a href="http://plugins.jquery.com/project/cookie">jQuery Cookie plugin</a> is used for managing cookie using jQuery. So include that too.</p>
<p>the html for increase, decrease links</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:void decreaseFont();&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;font-smaller&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Reduce font size&quot;</span>&gt;</span>-<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:void normalFont();&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;font-normal&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Normal font size&quot;</span>&gt;</span>0<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> 
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:void increaseFont();&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;font-bigger&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Increase font size&quot;</span>&gt;</span>+<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Add the following code just before the </body> tag.
<p>
<span id="more-552"></span></p>
<pre name="code" class="javascript">
<script type="text/javascript">
/*
Managing font
Author: Arun Vishnu

http://arunmvishnu.com/

*/
// Set the font sie during page load. Check cookie for stored font size
function currFontSize(){
	var crntFnt = $.cookie('userFontSize');
	if(crntFnt != null) {
		crntFnt = parseFloat(crntFnt, 10);
		$('html').css('font-size', crntFnt);
	}
	return false;
}
// normal font
function normalFont(){
	var domain = document.domain;
	$('html').css('font-size', 13);
	$.cookie('userFontSize', 13, { expires: 7, path: '/', domain: domain });
	return false;
}
// Increase font
function increaseFont(){
	var currentFontSize = $('html').css('font-size');
	var domain = document.domain;
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
    if(newFontSize<17){
    	$.cookie('userFontSize', newFontSize, { expires: 7, path: '/', domain: domain });
    	$('html').css('font-size', newFontSize);
    }
    return false;
}
// Decrease font
function decreaseFont(){
	var currentFontSize = $('html').css('font-size');
	var domain = document.domain;
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*.8;
    if(newFontSize>8){
    	$.cookie('userFontSize', newFontSize, { expires: 7, path: '/', domain: domain });
    	$('html').css('font-size', newFontSize);
    }
    return false;
}
// End of Managing font
</script>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://arunmvishnu.com/programming/javascript/font-resizing-using-jquery.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable right-click contextual menu</title>
		<link>http://arunmvishnu.com/programming/javascript/disable-right-click-contextual-menu.html</link>
		<comments>http://arunmvishnu.com/programming/javascript/disable-right-click-contextual-menu.html#comments</comments>
		<pubDate>Mon, 16 Mar 2009 09:44:36 +0000</pubDate>
		<dc:creator>Arun Vishnu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://arunmvishnu.com/?p=545</guid>
		<description><![CDATA[You can disable right-click contextual menu in your website using jQuery. Download and include jQuery library in your page and add the following code before the tag. $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); Thatz it]]></description>
			<content:encoded><![CDATA[<p>You can disable right-click contextual menu in your website using jQuery. Download and include jQuery library in your page and add the following code before the </body> tag.<br />
<span id="more-545"></span></p>
<pre name="code" class="javascript">
<script language="javascript" type="text/javascript">
$(document).ready(function(){
    $(document).bind("contextmenu",function(e){
        return false;
    });
});
</script>
</pre>
<p>Thatz it <img src='http://arunmvishnu.com/home/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://arunmvishnu.com/programming/javascript/disable-right-click-contextual-menu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a portable slideshow for your website, blog, Myspace, etc from your picasa web album</title>
		<link>http://arunmvishnu.com/tips-tricks/create-a-portable-slideshow-for-your-website-blog-myspace-etc-from-your-picasa-web-album.html</link>
		<comments>http://arunmvishnu.com/tips-tricks/create-a-portable-slideshow-for-your-website-blog-myspace-etc-from-your-picasa-web-album.html#comments</comments>
		<pubDate>Thu, 01 May 2008 18:40:00 +0000</pubDate>
		<dc:creator>Arun Vishnu</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://arunvishnuflip.wordpress.com/2008/05/01/create-a-portable-slideshow-for-your-website-blog-myspace-etc-from-your-picasa-web-album/</guid>
		<description><![CDATA[Create a portable slideshow for your website, blog, Myspace, etc from your picasa web album.. Using Picasa Web Albums you can create a Flash slideshow to embed in your blog or webpage. Each slideshow features built-in playback controls, size options, and the ability to display captions. To create and embed a slideshow: Sign in to your Google Account for Picasa Web Albums at http://picasaweb.google.com using your Google Account username and password. Click the My Photos [...]]]></description>
			<content:encoded><![CDATA[<p>Create a portable slideshow for your website, blog, Myspace, etc from your picasa web album..</p>
<p>Using Picasa Web Albums you can create a Flash slideshow to embed in  your blog or webpage. Each slideshow features built-in playback  controls, size options, and the ability to display captions. </p>
<p>To create and embed a slideshow:</p>
<ol>
<li>Sign in to your Google Account for Picasa Web Albums at <a target="_blank" href="http://picasaweb.google.com">http://picasaweb.google.com</a> using your Google Account username and password. </li>
<li>Click the <strong>My Photos</strong> link and select the album you&#8217;d like to make a slideshow.</li>
<li>Click the <strong>Embed Slideshow</strong> link. This creates a  Flash slideshow from the album you&#8217;ve selected. When you update this  album, your slideshow is automatically updated to show the latest  photos. </li>
<li>To embed the slideshow, copy and paste the HTML code that&#8217;s shown into your blog or webpage. </li>
</ol>
<p>Here is a sample album (My cats)</p>
]]></content:encoded>
			<wfw:commentRss>http://arunmvishnu.com/tips-tricks/create-a-portable-slideshow-for-your-website-blog-myspace-etc-from-your-picasa-web-album.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>File extension validation Javascript</title>
		<link>http://arunmvishnu.com/programming/javascript/file-extension-validation-javascript.html</link>
		<comments>http://arunmvishnu.com/programming/javascript/file-extension-validation-javascript.html#comments</comments>
		<pubDate>Wed, 27 Feb 2008 02:04:00 +0000</pubDate>
		<dc:creator>Arun Vishnu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://arunvishnuflip.wordpress.com/2008/02/27/file-extension-validation-javascript/</guid>
		<description><![CDATA[You can use this function to validate the extension of a file, for client side file upload checkes. // You can specify the file type in the code "valid_extensions = /(.doc&#124;.pdf)$/i;" . //If you want to add .docx supprt simply add &#124;.docx (ex:(.doc&#124;.pdf &#124;.docx&#124; .your-extension) ) var valid_extensions = /(.doc&#124;.pdf)$/i; function CheckExtension(fld) { if(fld.value) { if (valid_extensions.test(fld.value)){ return true; } else { return false; } } else { return true; } }]]></description>
			<content:encoded><![CDATA[<p>You can use this function to validate the extension of a file, for client side file upload checkes.</p>
<pre class="javascript" name="code">
// You can specify the file type in the code "valid_extensions = /(.doc|.pdf)$/i;" .
//If you want to add .docx supprt simply add |.docx (ex:(.doc|.pdf |.docx| .your-extension) ) 

var valid_extensions = /(.doc|.pdf)$/i;
function CheckExtension(fld)
{
	if(fld.value) {
		if (valid_extensions.test(fld.value)){
			return true;
		} else {
			return false;
		}
	} else {
		return true;
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://arunmvishnu.com/programming/javascript/file-extension-validation-javascript.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Javascript for validating a date</title>
		<link>http://arunmvishnu.com/programming/javascript/javascript-for-validating-a-date.html</link>
		<comments>http://arunmvishnu.com/programming/javascript/javascript-for-validating-a-date.html#comments</comments>
		<pubDate>Tue, 26 Feb 2008 01:57:00 +0000</pubDate>
		<dc:creator>Arun Vishnu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://arunvishnuflip.wordpress.com/2008/02/26/javascript-for-validating-a-date/</guid>
		<description><![CDATA[Javascript for validating a date. Pass month, day, year as parameters. This function will return true if the date is valid. // Author: arunmvishnu.com function validDate(month, day, year){ if(month =='0' &#124;&#124; day =='0' &#124;&#124; year=='0'){ return false; } switch(month){ case '1': //** jan case '3': //** March case '5': //** May case '7': //** July case '8': //** Aug case '10': //** Nov case '12': //** Dec if(day >=1 &#038;&#038; day =1 &#038;&#038; day =1 [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript for validating a date.</p>
<p>Pass month, day, year as parameters. This function will return true if the date is valid.</p>
<pre name="code" class="javascript">
// Author: arunmvishnu.com
function validDate(month, day, year){
	if(month =='0' || day =='0' || year=='0'){
		return false;
	}

	switch(month){
		case '1': //** jan
		case '3': //** March
		case '5': //** May
		case '7': //** July
		case '8': //** Aug
		case '10': //** Nov
		case '12': //** Dec

		if(day >=1 &#038;&#038; day <= 31){
			return true;
		} else {
			return false;
		}

		case '4': //** APRIL
		case '6' : //** JUNE
		case '9' : //** SEPTEMBER
		case '11' : //** NOVEMBER
		if(day >=1 &#038;&#038; day <= 30){
			return true;
		} else {
			return false;
		}

		case '2' : // Feb
		if(isLeapYear(year)){
			if(day >=1 &#038;&#038; day <= 29){
				return true;
			}
		} else if(day >=1 &#038;&#038; day <= 28){
			return true;
		} else {
			return false;
		}
		default:
			return false;
	}
}

function isLeapYear(year){  // Checking wdr a year is leap year or not
	if(year % 4 == 0 &#038;&#038; (year % 100 != 0 || year % 400 == 0)){
		return true;
	} else {
		return false;
	}
}
</pre>
<p>The full js file can be dodnloaded from<a href="http://arunmvishnu.googlepages.com/date_validation_js.js"> here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://arunmvishnu.com/programming/javascript/javascript-for-validating-a-date.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 1/14 queries in 0.061 seconds using disk: basic
Object Caching 775/794 objects using disk: basic

Served from: arunmvishnu.com @ 2011-12-08 22:58:05 -->
