<?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>Vijaya Kumar Blog &#187; Java Script</title>
	<atom:link href="http://vijayakumar.org/category/java-script/feed" rel="self" type="application/rss+xml" />
	<link>http://vijayakumar.org</link>
	<description>(Stunning PHP/MYSQL/AJAX/SEO Tips)</description>
	<lastBuildDate>Fri, 03 Sep 2010 02:06:20 +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>Calling Multiple Functions onclick Javascript</title>
		<link>http://vijayakumar.org/calling-multiple-functions-onclick-javascript.html</link>
		<comments>http://vijayakumar.org/calling-multiple-functions-onclick-javascript.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 16:23:38 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[Multiple Functions]]></category>
		<category><![CDATA[onclick Javascript]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=813</guid>
		<description><![CDATA[I am writing here to handle multiple Javascript functions in OnClick Event. To use multiple functions on Events, you want to add functions by separating with semicolon (;), For Ex: onclick = “testfun1(); testfun2();”. Each functions will run serially, first will be testfun1() and second testfun2(). To explain this functionality, I have enclosed working code [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing here to handle multiple Javascript functions in OnClick Event. To use multiple functions on Events, you want to add functions by separating with semicolon (;), For Ex: onclick = “testfun1(); testfun2();”. Each functions will run serially, first will be testfun1() and second testfun2(). To explain this functionality, I have enclosed working code below, </p>
<div align="center" style=" height:60px; width:234px;">
                  <script type="text/javascript"><!--
google_ad_client = "pub-2446805572506543";
/* 234x60, created 3/4/10 */
google_ad_slot = "1941779446";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
  </div>
<p> <br/><br/></p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</p>
<p>&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&gt;</p>
<p>&lt;title&gt;Calling Multiple Functions&lt;/title&gt;</p>
<p>&lt;script&gt;</p>
<p>function fun1() {</p>
<p>document.getElementById(&#8220;function1&#8243;).innerHTML = &#8220;This is run by function fun1()&#8221;;</p>
<p>}</p>
<p>function fun2() {</p>
<p>document.getElementById(&#8220;function2&#8243;).innerHTML = &#8220;This is run by function fun2()&#8221;;</p>
<p>}</p>
<p>function fun3() {</p>
<p>document.getElementById(&#8220;function3&#8243;).innerHTML = &#8220;This is run by function fun3()&#8221;;</p>
<p>}</p>
<p>&lt;/script&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;div style=&#8221;cursor:pointer;&#8221;&gt;Click me to run multiple functions through javascript parallel&lt;/div&gt;</p>
<p>&lt;div style=&#8221;color:#F00;&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;div style=&#8221;color:#096;&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;div style=&#8221;color:#9C3;&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></blockquote>
<div align="center" style=" height:60px; width:234px;">
                  <script type="text/javascript"><!--
google_ad_client = "pub-2446805572506543";
/* 234x60, created 3/4/10 */
google_ad_slot = "1941779446";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                </div>
<p><br/><br />
As per above code, once you clicked “Click me to run multiple functions through javascript parallel” link, it will runs 3 functions serially [fun1(), fun2(), fun3()]. First loads fun1() function. In fun1(), we have content as “This is run by function fun1()”. It will be loaded on div with id name function1. Second loads fun2() function. In fun2(), we have content as “This is run by function fun2()”. It will be loaded on div with id name function2. . Third loads fun3() function. In fun3(), we have content as “This is run by function fun3()”. It will be loaded on div with id name function3.</p>
<div align="center" style=" height:60px; width:234px;">
                  <script type="text/javascript"><!--
google_ad_client = "pub-2446805572506543";
/* 234x60, created 3/4/10 */
google_ad_slot = "1941779446";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
                </div>
<p><br/><br />
I guess you loved this tutorial. Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/calling-multiple-functions-onclick-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back and forward button in JavaScript</title>
		<link>http://vijayakumar.org/back-and-forward-button-in-javascript.html</link>
		<comments>http://vijayakumar.org/back-and-forward-button-in-javascript.html#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:45:07 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[backword button in JS]]></category>
		<category><![CDATA[forward button in JS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=531</guid>
		<description><![CDATA[Sure you can ask your visitors to use their brower&#8217;s BACK and FORWARD buttons to navigate your site. Wouldn&#8217;t it be nice to have your own BACK and FORWARD buttons on your pages: All you have to do is place the following HTML tags on your page: &#60;FORM METHOD=&#8221;post&#8221;&#62; &#60;INPUT TYPE=&#8221;button&#8221; VALUE=&#8221;BACK&#8221; OnClick=&#8221;history.go( -1 );return [...]]]></description>
			<content:encoded><![CDATA[<p>Sure you can ask your visitors to use their brower&#8217;s BACK and FORWARD buttons to navigate your site. Wouldn&#8217;t it be nice to have your own BACK and FORWARD buttons on your pages:</p>
<p>All you have to do is place the following HTML tags on your page:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;FORM METHOD=&#8221;post&#8221;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;INPUT TYPE=&#8221;button&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">VALUE=&#8221;BACK&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">OnClick=&#8221;history.go( -1 );return true;&#8221;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;INPUT TYPE=&#8221;button&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">VALUE=&#8221;FORWARD&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">OnClick=&#8221;history.go(  1 );return true;&#8221;&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&lt;/FORM&gt;</div>
<p><code>&lt;FORM METHOD="post"&gt;<br />
&lt;INPUT TYPE="button"<br />
VALUE="BACK"<br />
OnClick="history.go( -1 );return true;"&gt;<br />
&lt;INPUT TYPE="button"<br />
VALUE="FORWARD"<br />
OnClick="history.go(  1 );return true;"&gt;<br />
&lt;/FORM&gt;</code></p>
<p>As you can see, we&#8217;re simply using JavaScript&#8217;s &#8220;history object&#8221; to go back and forward.</p>
<p>If you prefer hyperlinks to buttons, use following tags instead:</p>
<p><code>&lt;A HREF="javascript:history.go(-1)"&gt;<br />
Go back<br />
&lt;/A&gt;<br />
&lt;A HREF="javascript:history.go(1)"&gt;<br />
Go forward<br />
&lt;/A&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/back-and-forward-button-in-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restricting the input field with maxlength</title>
		<link>http://vijayakumar.org/restricting-the-input-field-with-maxlength.html</link>
		<comments>http://vijayakumar.org/restricting-the-input-field-with-maxlength.html#comments</comments>
		<pubDate>Sat, 25 Jul 2009 18:38:46 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[maxlength]]></category>
		<category><![CDATA[Restricting the input field with maxlength]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=342</guid>
		<description><![CDATA[Restricting the input field value with maxlength specified using the below javascript here, function textLimit(field, maxlen) { if (field.value.length &#62; maxlen + 1) alert(’your input has been truncated!’); if (field.value.length &#62; maxlen) field.value = field.value.substring(0, maxlen); } This function is called on the input text onkeyup events, like below &#60;INPUT TYPE=”text” NAME=”dd” onkeyup=”textLimit(dd,10)”&#62;]]></description>
			<content:encoded><![CDATA[<p>Restricting the input field value with maxlength specified using the below javascript here,</p>
<p><span style="color: #0000ff;">function textLimit(field, maxlen)<br />
{<br />
if (field.value.length &gt; maxlen + 1)<br />
alert(’your input has been truncated!’);<br />
if (field.value.length &gt; maxlen)<br />
field.value = field.value.substring(0, maxlen);<br />
}</span></p>
<p>This function is called on the input text onkeyup events, like below</p>
<p><span style="color: #0000ff;">&lt;INPUT TYPE=”text” NAME=”dd” onkeyup=”textLimit(dd,10)”&gt;</span></p>
<input id="gwProxy" type="hidden" />
<p><!--Session data--><br />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden"><!--Session data--></input>
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/restricting-the-input-field-with-maxlength.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Page redirection depends upon visitors browsers</title>
		<link>http://vijayakumar.org/page-redirection-depends-upon-visitors-browsers.html</link>
		<comments>http://vijayakumar.org/page-redirection-depends-upon-visitors-browsers.html#comments</comments>
		<pubDate>Wed, 08 Jul 2009 18:45:22 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[assigning the browser name]]></category>
		<category><![CDATA[JavaScript Regular Expressions]]></category>
		<category><![CDATA[other_browsers.html]]></category>
		<category><![CDATA[Page redirection]]></category>
		<category><![CDATA[Perl language]]></category>
		<category><![CDATA[search() method]]></category>
		<category><![CDATA[visitors browsers]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=192</guid>
		<description><![CDATA[How to redirect visitors to different pages depending upon their browser using  java script. Is it possible? Yes, it’s possible. Here is the code, &#60;script type=”text/javascript”&#62; &#60;!– var bname = navigator.appName; if (bname.search(/netscape/i) == 0) { window.location=”netscape.html”; } else if (bname.search(/microsoft/i) == 0) { window.location=”internetexplorer.html”; } else { window.location=”other_browsers.html”; } //–&#62; &#60;/script&#62; After assigning the [...]]]></description>
			<content:encoded><![CDATA[<p>How to redirect visitors to different pages depending upon their browser using  java script. Is it possible? Yes, it’s possible. Here is the code,</p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">&lt;script type=”text/javascript”&gt;<br />
&lt;!–<br />
var bname = navigator.appName;<br />
if (bname.search(/netscape/i) == 0)<br />
{<br />
window.location=”netscape.html”;<br />
}<br />
else if (bname.search(/microsoft/i) == 0)<br />
{<br />
window.location=”internetexplorer.html”;<br />
}<br />
else<br />
{<br />
window.location=”other_browsers.html”;<br />
}<br />
//–&gt;<br />
&lt;/script&gt;</span></p>
<p>After assigning the browser name to bname, we search for the presence of specific words using JavaScript Regular Expressions. (JavaScript Regular expressions have been included in version 1.2 of the language and are based on those found in the Perl language. So if you were familiar with Perl, picking up the JavaScript regular expressions would be very simple).</p>
<p>The search() method searches for the string specified between the two forward slashes “/”. The ‘i’ modifier makes it possible for case sensitive searches.</p>
<p>The JavaScript If tests whether condition is true or false. Thus, Netscape users are redirected to netscape.html, Internet Explorer users to internetexplorer.html and other browsers to “other_browsers.html”. The above code has to be placed inside the HTML head. It can also be contained inside a function which can be called using the onload().</p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/page-redirection-depends-upon-visitors-browsers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Right mouse click using Javascript</title>
		<link>http://vijayakumar.org/disable-right-mouse-click-using-javascript.html</link>
		<comments>http://vijayakumar.org/disable-right-mouse-click-using-javascript.html#comments</comments>
		<pubDate>Mon, 06 Jul 2009 18:53:13 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[disabling right click option]]></category>
		<category><![CDATA[protect our website content]]></category>
		<category><![CDATA[source from stealing]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=139</guid>
		<description><![CDATA[While I searching for disabling right click option using Javascript code. I found this code on one of web site, This code will disable right click popup and also it will protect our website content, source from stealing. This code can be used in any HTML page. Features: a) This javascript function will disable the [...]]]></description>
			<content:encoded><![CDATA[<p>While I searching for disabling right click option using Javascript code. I found this code on one of web site, This code will disable right click popup and also it will protect our website content, source from stealing. This code can be used in any HTML page.</p>
<p><strong>Features:</strong></p>
<p>a) This javascript function will disable the right mouse click.<br />
b) This will stop users from easily stealing your site content and from view source.<br />
c) You can add the message as your wish.<br />
d) Just copy the code in to your page and enjoy the effect.</p>
<p><strong>Code:</strong><br />
<span style="color: #0000ff;">&lt;script language=javascript&gt;</span></p>
<p><span style="color: #0000ff;">var msg_box =&#8221;Right click prohibited&#8221;;</span></p>
<p><span style="color: #0000ff;">function dis_rightclickIE(){<br />
if (navigator.appName == &#8216;Microsoft Internet Explorer&#8217; &amp;&amp; (event.button == 2 || event.button == 3))<br />
alert(msg_box)<br />
}</span></p>
<p><span style="color: #0000ff;">function dis_rightclickNS(e){<br />
if ((document.layers||document.getElementById&amp;&amp;!document.all) &amp;&amp; (e.which==2||e.which==3))<br />
{<br />
alert(msg_box)<br />
return false;<br />
}<br />
}</span></p>
<p><span style="color: #0000ff;">if (document.layers){<br />
document.captureEvents(Event.MOUSEDOWN);<br />
document.onmousedown=dis_rightclickNS;<br />
}<br />
else if (document.all&amp;&amp;!document.getElementById){<br />
document.onmousedown=dis_rightclickIE;<br />
}<br />
document.oncontextmenu=new Function(&#8220;alert(msg_box);return false&#8221;)</span></p>
<p><span style="color: #0000ff;">&lt;/script&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/disable-right-mouse-click-using-javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Number Generation using java script</title>
		<link>http://vijayakumar.org/random-number-generation-using-java-script.html</link>
		<comments>http://vijayakumar.org/random-number-generation-using-java-script.html#comments</comments>
		<pubDate>Thu, 02 Jul 2009 19:34:36 +0000</pubDate>
		<dc:creator>Vijaya Kumar</dc:creator>
				<category><![CDATA[Java Script]]></category>
		<category><![CDATA[Random Number Generation using java script]]></category>

		<guid isPermaLink="false">http://www.vijayakumar.org/?p=83</guid>
		<description><![CDATA[While i searching for code in internet for random number generation in javascript. I fond this code. I hope it will usefull for some developers to integrate this code in their work. Try this code. Get random number in javascript by using readymade function random(): alert(Math.random()); Function to generate random numbers between range 1 to [...]]]></description>
			<content:encoded><![CDATA[<p>While i searching for code in internet for random number generation in javascript. I fond this code. I hope it will usefull for some developers to integrate this code in their work. Try this code.</p>
<p><strong>Get random number in javascript by using readymade function random():</strong></p>
<p><span style="color: #0000ff;">alert(Math.random());</span></p>
<p><strong>Function to generate random numbers between range 1 to N:</strong></p>
<p><span style="color: #0000ff;">function randomToN(maxVal,floatVal)<br />
{<br />
var randVal = Math.random()*maxVal;<br />
return typeof floatVal==&#8217;undefined&#8217;?Math.round(randVal):randVal.toFixed(floatVal);<br />
}</span></p>
<p><span style="color: #000000;">In above function, you want to pass 2 arguments, First argument , &#8220;</span><span style="color: #000000;"><span style="color: #0000ff;">maxVal</span>&#8221; Maximum number of value needed (N) and second argument, &#8220;</span><span style="color: #0000ff;">floatVal</span><span style="color: #000000;">&#8221; is optional which specifies number of digits after decimal point.  If u did&#8217;t give floatVal means, it will return value as integer.</span></p>
<p><span style="color: #000000;"><strong>Function to return a random numbers in a range:</strong><br />
</span></p>
<p><span style="color: #0000ff;">function randomXToY(minVal,maxVal,floatVal)<br />
{<br />
var randVal = minVal+(Math.random()*(maxVal-minVal));<br />
return typeof floatVal==&#8217;undefined&#8217;?Math.round(randVal):randVal.toFixed(floatVal);<br />
}</span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">Above function needs 3 arguments, First srgument, &#8220;</span></span><span style="color: #0000ff;">minVal</span><span style="color: #0000ff;"><span style="color: #000000;">&#8221; is minimum number to be started and &#8220;</span></span><span style="color: #0000ff;">maxVal</span><span style="color: #0000ff;"><span style="color: #000000;">&#8221; is a second argument, range between which the random number has to be generated. 3rd argument &#8220;</span></span><span style="color: #0000ff;">floatVal</span><span style="color: #0000ff;"><span style="color: #000000;">&#8221; is </span></span><span style="color: #000000;">which specifies number of digits after decimal point.  If u did&#8217;t give floatVal means, it will return value as integer.</span></p>
<p><span style="color: #000000;"><span style="color: #c0c0c0;">Sorry for bad english.</span><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://vijayakumar.org/random-number-generation-using-java-script.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
