<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: JavaScript &#8211; Auto Set Focus When Page is Done Loading</title>
	<atom:link href="http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-auto-set-focus-when-page-is-done-loading</link>
	<description>Fettes Programming Solutions</description>
	<lastBuildDate>Sun, 05 Feb 2012 08:57:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: sangita</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-10006</link>
		<dc:creator>sangita</dc:creator>
		<pubDate>Wed, 24 Nov 2010 13:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-10006</guid>
		<description>i have the problem to set focus. In my case when some on change event fire the page become loaded and the cursor move to the address bar of the web page .But i need to keep focus on same element after page load which is focused before.Plzzzzzzzzzzz urgent  help me... i have tried no of ways...

advanced thanks</description>
		<content:encoded><![CDATA[<p>i have the problem to set focus. In my case when some on change event fire the page become loaded and the cursor move to the address bar of the web page .But i need to keep focus on same element after page load which is focused before.Plzzzzzzzzzzz urgent  help me&#8230; i have tried no of ways&#8230;</p>
<p>advanced thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srimanta Chakraborty</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-8427</link>
		<dc:creator>Srimanta Chakraborty</dc:creator>
		<pubDate>Mon, 19 Apr 2010 09:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-8427</guid>
		<description>Thanks a lot for helping me to set the default focus on the text field.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for helping me to set the default focus on the text field.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Hatfield</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-450</link>
		<dc:creator>Joshua Hatfield</dc:creator>
		<pubDate>Mon, 15 Jun 2009 15:32:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-450</guid>
		<description>Edited:

[Note] -- = less than / greater than

@John I agree to an extent but if you have a commonly used input box on the top of the page, then you should add the focus code directly after the input while disregarding the onload event.

Example:
Search: --input type=&quot;text&quot; name=&quot;searchtext&quot; id=&quot;searchtext&quot; value=&quot;&quot; /--
--script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;--
s = document.getElementById(&#039;searchtext&#039;);
s.value = &#039;&#039;;   s.focus();
--/script--
--input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Search&quot; /--

Is it shitty to have Javascript outside the head element?  Yes.  But there are workarounds.</description>
		<content:encoded><![CDATA[<p>Edited:</p>
<p>[Note] &#8212; = less than / greater than</p>
<p>@John I agree to an extent but if you have a commonly used input box on the top of the page, then you should add the focus code directly after the input while disregarding the onload event.</p>
<p>Example:<br />
Search: &#8211;input type=&#8221;text&#8221; name=&#8221;searchtext&#8221; id=&#8221;searchtext&#8221; value=&#8221;" /&#8211;<br />
&#8211;script language=&#8221;JavaScript&#8221; type=&#8221;text/javascript&#8221;&#8211;<br />
s = document.getElementById(&#8216;searchtext&#8217;);<br />
s.value = &#8221;;   s.focus();<br />
&#8211;/script&#8211;<br />
&#8211;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;Search&#8221; /&#8211;</p>
<p>Is it shitty to have Javascript outside the head element?  Yes.  But there are workarounds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Hatfield</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-449</link>
		<dc:creator>Joshua Hatfield</dc:creator>
		<pubDate>Mon, 15 Jun 2009 15:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-449</guid>
		<description>@John I agree to an extent but if you have a commonly used input box on the top of the page, then you should add the focus code directly after the input while disregarding the onload event.

Example:
Search: 

s = document.getElementById(&#039;searchtext&#039;);
s.value = &#039;&#039;;   s.focus();



Is it shitty to have Javascript outside the head element?  Yes.  But there are workarounds.</description>
		<content:encoded><![CDATA[<p>@John I agree to an extent but if you have a commonly used input box on the top of the page, then you should add the focus code directly after the input while disregarding the onload event.</p>
<p>Example:<br />
Search: </p>
<p>s = document.getElementById(&#8216;searchtext&#8217;);<br />
s.value = &#8221;;   s.focus();</p>
<p>Is it shitty to have Javascript outside the head element?  Yes.  But there are workarounds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wendelin</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-448</link>
		<dc:creator>Eric Wendelin</dc:creator>
		<pubDate>Mon, 15 Jun 2009 15:14:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-448</guid>
		<description>Oh also, document.activeElement was IE-only last I heard. Bad!</description>
		<content:encoded><![CDATA[<p>Oh also, document.activeElement was IE-only last I heard. Bad!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wendelin</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-447</link>
		<dc:creator>Eric Wendelin</dc:creator>
		<pubDate>Mon, 15 Jun 2009 15:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-447</guid>
		<description>Agreed with John. 

What if.... we checked if all inputs are empty before focusing anything? This is trivial to do in JavaScript, and would make it a LOT less annoying.</description>
		<content:encoded><![CDATA[<p>Agreed with John. </p>
<p>What if&#8230;. we checked if all inputs are empty before focusing anything? This is trivial to do in JavaScript, and would make it a LOT less annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Rockefeller</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-441</link>
		<dc:creator>John Rockefeller</dc:creator>
		<pubDate>Mon, 15 Jun 2009 12:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-441</guid>
		<description>You&#039;re my friend, Fettes, but I totally disagree here. The most annoying thing in the world (next to rebooting for Windows Vista updates) is when your cursor moves as you&#039;re typing something because you navigated to a new page. Let me control my own mouse and stop moving the focus.

A user interface should never move as you go to use it!!!</description>
		<content:encoded><![CDATA[<p>You&#8217;re my friend, Fettes, but I totally disagree here. The most annoying thing in the world (next to rebooting for Windows Vista updates) is when your cursor moves as you&#8217;re typing something because you navigated to a new page. Let me control my own mouse and stop moving the focus.</p>
<p>A user interface should never move as you go to use it!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baimusenlin</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-438</link>
		<dc:creator>baimusenlin</dc:creator>
		<pubDate>Mon, 15 Jun 2009 07:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-438</guid>
		<description>i use jquery 
$(document).ready(function(){

   $(&quot;#loginName&quot;).focus();
});</description>
		<content:encoded><![CDATA[<p>i use jquery<br />
$(document).ready(function(){</p>
<p>   $(&#8220;#loginName&#8221;).focus();<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thezilch</title>
		<link>http://www.fettesps.com/javascript-auto-set-focus-when-page-is-done-loading/comment-page-1/#comment-411</link>
		<dc:creator>thezilch</dc:creator>
		<pubDate>Sun, 14 Jun 2009 07:17:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.fettesps.com/?p=272#comment-411</guid>
		<description>If using this technique, consider using document.activeElement first to discover whether you would stealing focus from already focused, form elements or other notable page elements.</description>
		<content:encoded><![CDATA[<p>If using this technique, consider using document.activeElement first to discover whether you would stealing focus from already focused, form elements or other notable page elements.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

