<?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>JSP, Tomcat, JDBC, Projects, Example, Program &#187; JavaScript</title>
	<atom:link href="http://www.easywayserver.com/blog/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.easywayserver.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 04 Jun 2011 05:32:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use JavaScript in HTML page</title>
		<link>http://www.easywayserver.com/blog/how-to-use-javascript-in-html-page/</link>
		<comments>http://www.easywayserver.com/blog/how-to-use-javascript-in-html-page/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 06:24:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=78</guid>
		<description><![CDATA[JavaScript is a dynamic programming language. It can use for dynamic content. JavaScript can use with html page inside &#60;body&#62; tag and inside of &#60;script&#62; tag in &#60;head&#62; tags.
JavaScript code can be written on separate JS file. This JS file can be included in html page. It is a good practice of programming to keep [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fhow-to-use-javascript-in-html-page%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fhow-to-use-javascript-in-html-page%2F" height="61" width="51" /></a></div><p>JavaScript is a dynamic programming language. It can use for dynamic content. JavaScript can use with html page inside &lt;body&gt; tag and inside of &lt;script&gt; tag in &lt;head&gt; tags.</p>
<p>JavaScript code can be written on separate JS file. This JS file can be included in html page. It is a good practice of programming to keep everything separate. In JavaScript, we can make functions and global code. Functions can be fired by explicit events. These events are onClick, onFocus, onBlur onMouseOver.</p>
<p>Important thing is JavaScript and HTML both execute at browser. Output will come at same time.</p>
<p>We are going to add JavaScript code. See how to use JavaScript in HTML page by example.</p>
<p>1.	Where can add JavaScript</p>
<p>2.	Run JavaScript code automatically</p>
<p>3.	Display text string in JavaScript.</p>
<p><strong>Where to add JavaScript</strong></p>
<p>Head tags with code</p>
<div class="cde">
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;How to use JavaScript in HTML page &lt;/title&gt;
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> alertMe<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
    alert<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;This is javascript code&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>

&lt;/head&gt;
</pre>
</div>
<p>Include JS file</p>
<div class="cde">
<pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Include JavaScript in HTML page &lt;/title&gt;
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script src=&quot;include.js&quot;</span><span style='color:#a65700; '>></span><span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>

&lt;/head&gt;
</pre>
</div>
<p>Code in body tag</p>
<div class="cde">
<pre>
&lt;/head&gt;

&lt;body&gt;
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
   <span style='color:#800000; font-weight:bold; '>var</span> str<span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;This is javascript variable&quot;</span><span style='color:#800080; '>;</span>
   alert<span style='color:#808030; '>(</span>str<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
&lt;/body&gt;
&lt;/html&gt;
</pre>
</div>
<p><strong>Run JavaScript code automatically</strong></p>
<p>JavaScript code inside body tag run automatically </p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Run JavaScript code automatically<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
   <span style='color:#800000; font-weight:bold; '>var</span> str<span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;This is javascript variable&quot;</span><span style='color:#800080; '>;</span>
   alert<span style='color:#808030; '>(</span>str<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Display text string in JavaScript</strong></p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Display JavaScript code<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
   <span style='color:#800000; font-weight:bold; '>var</span> str<span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;This is javascript variable&quot;</span><span style='color:#800080; '>;</span>
   document<span style='color:#808030; '>.</span>write<span style='color:#808030; '>(</span>str<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-javascript-href/" rel="bookmark" class="crp_title">Calling JavaScript href</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-url/" rel="bookmark" class="crp_title">JavaScript &#8211; Get URL</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-call-functions/" rel="bookmark" class="crp_title">Javascript &#8211;  Call Functions</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-redirect/" rel="bookmark" class="crp_title">JavaScript &#8211;  Redirect</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-background-color/" rel="bookmark" class="crp_title">JavaScript &#8211; Background color</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-parent-child-function-in-frame/" rel="bookmark" class="crp_title">Calling parent child function in frame</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/how-to-use-javascript-in-html-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Submit a Form Using JavaScript</title>
		<link>http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/</link>
		<comments>http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 11:20:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=75</guid>
		<description><![CDATA[Form can be submitted by submit button. If you are looking to submit form with explicit function, JavaScript can help you in submitting form with submit function. 
Before using submit function you need a form in webpage.
This javascript submit function can call by any event of html tag. This can be onclick of anchor tag, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fhow-to-submit-a-form-using-javascript%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fhow-to-submit-a-form-using-javascript%2F" height="61" width="51" /></a></div><p>Form can be submitted by submit button. If you are looking to submit form with explicit function, JavaScript can help you in submitting form with submit function. </p>
<p>Before using submit function you need a form in webpage.</p>
<p>This javascript submit function can call by any event of html tag. This can be onclick of anchor tag, button tag.</p>
<p>Submit function</p>
<div class="cde">document.formName.submit();</div>
<p>Can call from any attribute</p>
<div class="cde">&lt;a href=&#8221;javascript:goSubmit()&#8221; &gt;Submit form &lt;/a &gt;</div>
<p>Or can be</p>
<div class="cde">&lt;input type=&#8221;button&#8221; name=&#8221;btn&#8221; value=&#8221;Submit&#8221; onClick=&#8221;goSubmit()&#8221;&gt;</div>
<p>Full example code</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Submit form using javascript<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> goSubmit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
  document<span style='color:#808030; '>.</span>frm<span style='color:#808030; '>.</span>submit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;frm&quot;</span><span style='color:#a65700; '>></span>
 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:goSubmit()&quot;</span><span style='color:#a65700; '>></span>Submit form <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>br</span><span style='color:#a65700; '>></span>
 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>input</span><span style='color:#274796; '> </span><span style='color:#074726; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;button&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;btn&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>value</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;Submit&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>onClick</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;goSubmit()&quot;</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/" rel="bookmark" class="crp_title">JavaScript – Submit is not a function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/more-than-one-form-in-html-page/" rel="bookmark" class="crp_title">More than one form in HTML page</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-javascript-href/" rel="bookmark" class="crp_title">Calling JavaScript href</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/confirm-javascript/" rel="bookmark" class="crp_title">Confirm Javascript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-focus-function/" rel="bookmark" class="crp_title">JavaScript &#8211; Focus function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-select-checkbox/" rel="bookmark" class="crp_title">JavaScript – Select Checkbox</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Calling JavaScript href</title>
		<link>http://www.easywayserver.com/blog/calling-javascript-href/</link>
		<comments>http://www.easywayserver.com/blog/calling-javascript-href/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 07:22:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=74</guid>
		<description><![CDATA[JavaScript function and code can be executed from href event of anchor tag. Instead of passing URL of page we can pass JavaScript function in href attribute. The page will not submit to any other page, if you are using JavaScript in href. We will show you how to use JavaScript in href and calling [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fcalling-javascript-href%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fcalling-javascript-href%2F" height="61" width="51" /></a></div><p>JavaScript function and code can be executed from href event of anchor tag. Instead of passing URL of page we can pass JavaScript function in href attribute. The page will not submit to any other page, if you are using JavaScript in href. We will show you how to use JavaScript in href and calling JavaScript in href.</p>
<p>It will remain an interactive input for user and user can do function according to their need. We don&#39;t need to make button or submit button to execute JavaScript functions. It is easier to do interact with user.</p>
<p>We have to add javascript: before calling function of JavaScript.</p>
<div class="cde">
<p> &lt;a href=&#8221;javascript:callHref()&#8221; &gt;Calling JavaScript Href  &lt;/a &gt;</p>
</div>
<p>Full example</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Calling JavaScript Href<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> callHref<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
  alert<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Function is called from Href&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:callHref()&quot;</span><span style='color:#a65700; '>></span>Calling JavaScript Href <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p><iframe src="http://www.easywayserver.com/demo/javascripthref.html" style="border: 1px solid rgb(204, 204, 204); width: 592px; height: 70px;" frameborder="0"></iframe></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-call-functions/" rel="bookmark" class="crp_title">Javascript &#8211;  Call Functions</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/" rel="bookmark" class="crp_title">JavaScript – Submit is not a function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-redirect/" rel="bookmark" class="crp_title">JavaScript &#8211;  Redirect</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-parent-child-function-in-frame/" rel="bookmark" class="crp_title">Calling parent child function in frame</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-background-color/" rel="bookmark" class="crp_title">JavaScript &#8211; Background color</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/" rel="bookmark" class="crp_title">How to Submit a Form Using JavaScript</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/calling-javascript-href/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; Get URL</title>
		<link>http://www.easywayserver.com/blog/javascript-get-url/</link>
		<comments>http://www.easywayserver.com/blog/javascript-get-url/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 07:18:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=71</guid>
		<description><![CDATA[JavaScript can get full URL of webpage. Server side script is not required if you are looking for URL of browser. JavaScript have function to get full URL with location object.
window.location object return full path of webpage opened on web browser and manipulate with split function.
Location object returns with host name, port, protocol (http or [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-get-url%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-get-url%2F" height="61" width="51" /></a></div><p>JavaScript can get full URL of webpage. Server side script is not required if you are looking for URL of browser. JavaScript have function to get full URL with location object.</p>
<p><strong>window.location</strong> object return full path of webpage opened on web browser and manipulate with split function.</p>
<p>Location object returns with host name, port, protocol (http or https), file name and query string with variable name and value in escaped string.</p>
<p>URL string can further use for making new URL or modification of URL with split array and href of location object.</p>
<div class="cde">
<pre>window.location</pre>
</div>
<p>&nbsp;</p>
<div class="cde">
<pre>window.location.href</pre>
</div>
<p>full example code</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Javascript get url<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
document<span style='color:#808030; '>.</span>write<span style='color:#808030; '>(</span>document<span style='color:#808030; '>.</span>location<span style='color:#808030; '>.</span>href<span style='color:#808030; '>)</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p style="border:1px solid #aaaaaa">&nbsp;<br />&nbsp;<script>document.write(document.location.href)</script>&nbsp;<br />&nbsp;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-redirect/" rel="bookmark" class="crp_title">JavaScript &#8211;  Redirect</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-javascript-href/" rel="bookmark" class="crp_title">Calling JavaScript href</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-focus-function/" rel="bookmark" class="crp_title">JavaScript &#8211; Focus function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-background-color/" rel="bookmark" class="crp_title">JavaScript &#8211; Background color</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-getelementsbytagname/" rel="bookmark" class="crp_title">JavaScript &#8211; getElementsByTagName</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-use-javascript-in-html-page/" rel="bookmark" class="crp_title">How to use JavaScript in HTML page</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-get-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; Focus function</title>
		<link>http://www.easywayserver.com/blog/javascript-focus-function/</link>
		<comments>http://www.easywayserver.com/blog/javascript-focus-function/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 05:47:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=70</guid>
		<description><![CDATA[Focus will keep object to ready for work. If you loose focus from object you cannot do work on that object. We can work on only active object. To activate object we need focus on that. JavaScript focus function solves our problem. Focus on text field keeps the cursor inside text field and we can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-focus-function%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-focus-function%2F" height="61" width="51" /></a></div><p>Focus will keep object to ready for work. If you loose focus from object you cannot do work on that object. We can work on only active object. To activate object we need focus on that. JavaScript focus function solves our problem. Focus on text field keeps the cursor inside text field and we can start writing in the field.</p>
<p>If we want to select text and copy text, focus should be on that window. Window can be focused by focus function.</p>
<p>Focus function helps to focus on almost all input field (Select, password, radio button, checkbox) and user does not need to use mouse. Only keyword will do all input and submit the form.</p>
<div class="cde">
<pre>document.formName.fieldName.focus();</pre>
</div>
<p>&nbsp;</p>
<div class="cde">
<pre>window.focus();</pre>
</div>
<p>Full example </p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Javascript focus<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> getFocus<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
 document<span style='color:#808030; '>.</span>frm<span style='color:#808030; '>.</span>fieldName<span style='color:#808030; '>.</span>focus<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;frm&quot;</span><span style='color:#a65700; '>></span>

 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>input</span><span style='color:#274796; '> </span><span style='color:#074726; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;text&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;fieldName&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>/></span>

<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>getFocus<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/password-field-in-html/" rel="bookmark" class="crp_title">Password Field in HTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-select-checkbox/" rel="bookmark" class="crp_title">JavaScript – Select Checkbox</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-checkbox-value/" rel="bookmark" class="crp_title">JavaScript &#8211; Get Checkbox Value</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/" rel="bookmark" class="crp_title">JavaScript – Submit is not a function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/" rel="bookmark" class="crp_title">How to Submit a Form Using JavaScript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/more-than-one-form-in-html-page/" rel="bookmark" class="crp_title">More than one form in HTML page</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-focus-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling parent child function in frame</title>
		<link>http://www.easywayserver.com/blog/calling-parent-child-function-in-frame/</link>
		<comments>http://www.easywayserver.com/blog/calling-parent-child-function-in-frame/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 06:14:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=68</guid>
		<description><![CDATA[Frame is partition of window into many windows. It is useful when we want to keep things separate from other windows. Frame helps us to include header or footer or menu navigator in left or right side. 
Everything works fine if we don&#39;t have work with one frame to other frame. It is not possible [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fcalling-parent-child-function-in-frame%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fcalling-parent-child-function-in-frame%2F" height="61" width="51" /></a></div><p>Frame is partition of window into many windows. It is useful when we want to keep things separate from other windows. Frame helps us to include header or footer or menu navigator in left or right side. </p>
<p>Everything works fine if we don&#39;t have work with one frame to other frame. It is not possible that frame is not linked with other frames. So we need to interact with other frames with JavaScript function. </p>
<p>Every frame is parent or child of parent. Every frame has own id and frame name which differentiate one frame to other frames. We denote frame as child or parent. This makes it easy to access other frame from frame to frame. </p>
<p>Let&#39;s take an example we have three frames </p>
<p>one is left frame</p>
<p>second is top frame</p>
<p>third is main frame</p>
<p>left frame name=&#8221;leftFrame&#8221;</p>
<p>top frame name=&#8221;topFrame&#8221;</p>
<p>main frame name=&#8221;mainFrame&#8221;</p>
<p><img src="http://www.easywayserver.com/images/parentframe.jpg" border="0" style="border:1px solid #999999"></p>
<p>We have a javascript function in child parent in main frame. </p>
<p>Syntax of calling frame function</p>
<div class="cde">
<pre>parent.frameName.functionName()</pre>
</div>
<p>We want to call this function from top frame.</p>
<div class="cde">
<pre>parent.mainFrame.callFunctionMain(); </pre>
</div>
<p>If you want to call function of top frame from main frame</p>
<div class="cde">
<pre>parent.topFrame.callIt();</pre>
</div>
<p>full code example </p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Main Frame<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>frameset</span><span style='color:#274796; '> </span><span style='color:#074726; '>rows</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;*&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>cols</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;80,*&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>frameborder</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;yes&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>border</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;1&quot;</span><span style='color:#a65700; '>></span>

  <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>frame</span><span style='color:#274796; '> </span><span style='color:#074726; '>src</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;left.html&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;leftFrame&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>id</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;leftFrame&quot;</span><span style='color:#274796; '>  </span><span style='color:#a65700; '>/></span>

  <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>frameset</span><span style='color:#274796; '> </span><span style='color:#074726; '>rows</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;80,*&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>frameborder</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;yes&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>border</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;1&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>></span>
    <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>frame</span><span style='color:#274796; '> </span><span style='color:#074726; '>src</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;top.html&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;topFrame&quot;</span><span style='color:#274796; '>  </span><span style='color:#074726; '>id</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;topFrame&quot;</span><span style='color:#274796; '>  </span><span style='color:#a65700; '>/></span>
    <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>frame</span><span style='color:#274796; '> </span><span style='color:#074726; '>src</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;main.html&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;mainFrame&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>id</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;mainFrame&quot;</span><span style='color:#274796; '>  </span><span style='color:#a65700; '>/></span>
  <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>frameset</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>frameset</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>left.html</strong></p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>left Frame<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
This is left Frame
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>top.html</strong></p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>top Frame<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> callIt<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
  alert<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;This is function calling&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>

<span style='color:#800000; font-weight:bold; '>function</span> callMainParent<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
  parent<span style='color:#808030; '>.</span>mainFrame<span style='color:#808030; '>.</span>callMain<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
This is top frame

 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:callMainParent()&quot;</span><span style='color:#a65700; '>></span>Call main frame function<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>main.html</strong></p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Main Frame<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> callParent<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
 parent<span style='color:#808030; '>.</span>topFrame<span style='color:#808030; '>.</span>callIt<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>

<span style='color:#800000; font-weight:bold; '>function</span> callMain<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
alert<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;This is main frame function&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>

<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
This is main frame

 <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:callParent()&quot;</span><span style='color:#a65700; '>></span>Call top frame function<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p><iframe src="http://www.easywayserver.com/demo/frame/frame.html" style="border: 1px solid rgb(204, 204, 204); width: 592px; height: 200px;" frameborder="0"></iframe></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/include-file-in-html/" rel="bookmark" class="crp_title">Include File in HTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-call-functions/" rel="bookmark" class="crp_title">Javascript &#8211;  Call Functions</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-print/" rel="bookmark" class="crp_title">JavaScript &#8211; Print Page</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-select-checkbox/" rel="bookmark" class="crp_title">JavaScript – Select Checkbox</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-change-css-class-dynamically/" rel="bookmark" class="crp_title">JavaScript – Change CSS class dynamically</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/html-select-box-option-group/" rel="bookmark" class="crp_title">HTML &#8211; Select box option group</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/calling-parent-child-function-in-frame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; getElementsByTagName</title>
		<link>http://www.easywayserver.com/blog/javascript-getelementsbytagname/</link>
		<comments>http://www.easywayserver.com/blog/javascript-getelementsbytagname/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 06:26:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=66</guid>
		<description><![CDATA[getElementsByTagName is used to get tag information in document.
This is in form of collection and array of tags. We can work with individual tag of HTML in webpage with getElementsByTagName method.
We will show you to how to use this method in webpage
We can get value inside of tag with particular single tag.

document.getElementsByTagName(&#34;p&#34;).item(0).innerHTML


This will pick first [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-getelementsbytagname%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-getelementsbytagname%2F" height="61" width="51" /></a></div><p>getElementsByTagName is used to get tag information in document.</p>
<p>This is in form of collection and array of tags. We can work with individual tag of HTML in webpage with getElementsByTagName method.</p>
<p>We will show you to how to use this method in webpage</p>
<p>We can get value inside of tag with particular single tag.</p>
<div class="cde">
<pre style='color:#000000;'>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>item</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>innerHTML
</pre>
</div>
<p>This will pick first item tag of paragraph with numeric value and get innerHTML of this p tag.</p>
<div class="cde">
<pre style='color:#000000;'>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.length</span>
</pre>
</div>
<p>This will return the number of p tags in full document, if you are using 5 paragraph tags inside document. It will return 5.</p>
<div class="cde">
<pre style='color:#000000;'>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>namedItem<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;pID&quot;</span><span style='color:#808030; '>)</span>
</pre>
</div>
<p>This will work with individual element id, and get the property of element. We can get style property, font property</p>
<div class="cde">
<pre style='color:#000000;'>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>namedItem<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;pID&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>style<span style='color:#808030; '>.</span>background
</pre>
</div>
<p>&nbsp;</p>
<div class="cde">
<pre style='color:#000000;'>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>namedItem<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;pID&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>style<span style='color:#808030; '>.</span>font
</pre>
</div>
<p>Full code example</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>getElementsByTagName Javascript<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> getElementFtn<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
 alert<span style='color:#808030; '>(</span>document<span style='color:#808030; '>.</span>getElementsByTagName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;p&quot;</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>item</span><span style='color:#808030; '>(</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>innerHTML<span style='color:#808030; '>)</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>this is first tag<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>this is second<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#274796; '> </span><span style='color:#074726; '>id</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;pID&quot;</span><span style='color:#a65700; '>></span>this is third tag<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>this is forth tag<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>this is fifth tag<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>p</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:getElementFtn()&quot;</span><span style='color:#a65700; '>></span>check this element<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-how-to-read-xml-file/" rel="bookmark" class="crp_title">JAVA &#8211; How to read XML file</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-url/" rel="bookmark" class="crp_title">JavaScript &#8211; Get URL</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-innerhtml/" rel="bookmark" class="crp_title">JavaScript innerHTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-background-color/" rel="bookmark" class="crp_title">JavaScript &#8211; Background color</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-change-text-font-color-in-html/" rel="bookmark" class="crp_title">JavaScript &#8211; Change Text Font Color in HTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-checkbox-value/" rel="bookmark" class="crp_title">JavaScript &#8211; Get Checkbox Value</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-getelementsbytagname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211;  Redirect</title>
		<link>http://www.easywayserver.com/blog/javascript-redirect/</link>
		<comments>http://www.easywayserver.com/blog/javascript-redirect/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 09:03:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=62</guid>
		<description><![CDATA[If you want to redirect web page to another, javascript have simple function for it. Sometimes we need to redirect user to another web page to achieve our goal. We can do this in JavaScript by location function.
Just we need to call this function to redirect our page by firing events. This redirection will be [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-redirect%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-redirect%2F" height="61" width="51" /></a></div><p>If you want to redirect web page to another, javascript have simple function for it. Sometimes we need to redirect user to another web page to achieve our goal. We can do this in JavaScript by location function.</p>
<p>Just we need to call this function to redirect our page by firing events. This redirection will be client side and execute on user machine. </p>
<p>Redirecting page in JavaScript can be done by three functions</p>
<div class="cde">
<pre style='color:#000000;'>window<span style='color:#808030; '>.</span>location <span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;http://www.yahoo.com&quot;</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p>&nbsp;</p>
<div class="cde">
<pre style='color:#000000;'>window<span style='color:#808030; '>.</span>location<span style='color:#808030; '>.</span>href<span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;http://www.yahoo.com&quot;</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p>&nbsp;</p>
<div class="cde">
<pre style='color:#000000;'>window<span style='color:#808030; '>.</span>location<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>replace</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;http://www.yahoo.com&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
</pre>
</div>
<p>location.replace functions will not create entry in history, it just simply edit location with new location URL. This means you cannot go back if you use location replace function.</p>
<p>Full code in html</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Javascript redirect<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> redirectJS<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
 <span style='color:#696969; '>//window.location=&quot;http://www.yahoo.com&quot;;</span>
 <span style='color:#696969; '>// window.location.href=&quot;http://www.yahoo.com&quot;;</span>
 window<span style='color:#808030; '>.</span>location<span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>replace</span><span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;http://www.yahoo.com&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> <span style='color:#696969; '>//not create entry in history</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:redirectJS()&quot;</span><span style='color:#a65700; '>></span>Redirect in Javascript<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p><iframe src="http://www.easywayserver.com/demo/redirect.html" style="border: 1px solid rgb(204, 204, 204); width: 592px; height: 70px;" frameborder="0"></iframe></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-url/" rel="bookmark" class="crp_title">JavaScript &#8211; Get URL</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/html-redirect/" rel="bookmark" class="crp_title">HTML &#8211; Redirect</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-javascript-href/" rel="bookmark" class="crp_title">Calling JavaScript href</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/confirm-javascript/" rel="bookmark" class="crp_title">Confirm Javascript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-close-window/" rel="bookmark" class="crp_title">JavaScript &#8211; close window</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-background-color/" rel="bookmark" class="crp_title">JavaScript &#8211; Background color</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript – Submit is not a function</title>
		<link>http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/</link>
		<comments>http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 11:11:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=60</guid>
		<description><![CDATA[Sometimes we need to submit web form by JavaScript, and need to use submit function of JavaScript. Suddenly we get an error of &#8220;submit is not a function&#8221;, we could not understand. Everyone knows that submit is a function in JavaScript. Many of times we have used in web form. 
You have to keep your [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-%25e2%2580%2593-submit-is-not-a-function%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-%25e2%2580%2593-submit-is-not-a-function%2F" height="61" width="51" /></a></div><p>Sometimes we need to submit web form by JavaScript, and need to use submit function of JavaScript. Suddenly we get an error of &#8220;submit is not a function&#8221;, we could not understand. Everyone knows that submit is a function in JavaScript. Many of times we have used in web form. </p>
<p>You have to keep your mind cool and find out what is the real problem why submit is not working.</p>
<p>Most of the time when submit is not working because of confliction of two same name of submit property in web page.</p>
<p>We use submit button in input type and put same name in button as submit</p>
<p class="dpr">Example of wrong button name</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#808030; '>&lt;</span>input type<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>submit</span><span style='color:#800000; '>&quot;</span> name<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>submit</span><span style='color:#800000; '>&quot;</span> value<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>Submit</span><span style='color:#800000; '>&quot;</span> <span style='color:#808030; '>/</span><span style='color:#808030; '>></span>
</pre>
</div>
<p>Correct button name</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#808030; '>&lt;</span>input type<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>submit</span><span style='color:#800000; '>&quot;</span> name<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>goSubmit</span><span style='color:#800000; '>&quot;</span> value<span style='color:#808030; '>=</span><span style='color:#800000; '>&quot;</span><span style='color:#0000e6; '>Submit</span><span style='color:#800000; '>&quot;</span> <span style='color:#808030; '>/</span><span style='color:#808030; '>></span>
</pre>
</div>
<p>Check above button name in your webpage. Is submit name is used in submit button, if yes. Both name function name and button name will conflict with each other. </p>
<p>Simple change button name with other name instead of using submit name. This will solve the error of submit is not a function.</p>
<p>Mostly we do code like this</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Javascript submit is not a function<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#800000; font-weight:bold; '>function</span> goSubmit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
  document<span style='color:#808030; '>.</span>frm<span style='color:#808030; '>.</span>submit<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>script</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;frm&quot;</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#274796; '> </span><span style='color:#074726; '>href</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;javascript:goSubmit()&quot;</span><span style='color:#a65700; '>></span>Submit form Error if you use this<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>a</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>input</span><span style='color:#274796; '> </span><span style='color:#074726; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;submit&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;submit&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>value</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;Submit&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>/></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p><iframe src="http://www.easywayserver.com/demo/submit.html" style="border: 1px solid rgb(204, 204, 204); width: 592px; height: 70px;" frameborder="0"></iframe></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/" rel="bookmark" class="crp_title">How to Submit a Form Using JavaScript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/more-than-one-form-in-html-page/" rel="bookmark" class="crp_title">More than one form in HTML page</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/calling-javascript-href/" rel="bookmark" class="crp_title">Calling JavaScript href</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/confirm-javascript/" rel="bookmark" class="crp_title">Confirm Javascript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-submit-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; Submit tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/jsp-%e2%80%93-fetching-value-of-radio-button/" rel="bookmark" class="crp_title">JSP – Fetching Value of Radio Button</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; close window</title>
		<link>http://www.easywayserver.com/blog/javascript-close-window/</link>
		<comments>http://www.easywayserver.com/blog/javascript-close-window/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 07:27:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=58</guid>
		<description><![CDATA[JavaScript allow us to close window with inbuilt functions. 
This is easier for user to close window with just pressing link or button. User doesn&#39;t have to go through browser file close option. This will work with pop up window of browser. 
Javascript have function to close window
window.close() 
self.close()
This function closes window which is opened. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-close-window%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjavascript-close-window%2F" height="61" width="51" /></a></div><p>JavaScript allow us to close window with inbuilt functions. </p>
<p>This is easier for user to close window with just pressing link or button. User doesn&#39;t have to go through browser file close option. This will work with pop up window of browser. </p>
<p>Javascript have function to close window</p>
<p><strong>window.close() </strong></p>
<p><strong>self.close()</strong></p>
<p>This function closes window which is opened. </p>
<p>The example of closing window is given where you can test how it works.</p>
<div class="cde">
<pre style='color:#000000;'><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Javascript close window<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>input</span><span style='color:#274796; '> </span><span style='color:#074726; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;button&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;btn&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>value</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;Close&quot;</span><span style='color:#274796; '> </span><span style='color:#074726; '>onclick</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;window.close()&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>/></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p><strong>Demo</strong></p>
<p style="border:1px solid #CCCCCC">&nbsp;<br />&nbsp;&nbsp;<br />
<input type="button" name="btn" value="Open Window to close" onclick="javascript:window.open('http://www.easywayserver.com/demo/close.html','a','width=100,height=100')" />&nbsp;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-print/" rel="bookmark" class="crp_title">JavaScript &#8211; Print Page</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-back-forward-button/" rel="bookmark" class="crp_title">JavaScript &#8211; Back forward button</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/confirm-javascript/" rel="bookmark" class="crp_title">Confirm Javascript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-focus-function/" rel="bookmark" class="crp_title">JavaScript &#8211; Focus function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-redirect/" rel="bookmark" class="crp_title">JavaScript &#8211;  Redirect</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-get-url/" rel="bookmark" class="crp_title">JavaScript &#8211; Get URL</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/javascript-close-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

