<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Client Side Web Development</title><link>http://forums.asp.net/130.aspx</link><description>Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=18&amp;c=16" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2382693.aspx</link><pubDate>Tue, 27 May 2008 11:33:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2382693</guid><dc:creator>dotdodont</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2382693.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2382693</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;of course, thanks I should&amp;#39;ve known.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2364579.aspx</link><pubDate>Sun, 18 May 2008 14:28:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2364579</guid><dc:creator>NC01</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2364579.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2364579</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;dotdodont:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;thanks for ALL the responses, I just thought the script would automatically execute anyway. but window.onload does the trick.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks again&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;The script is execution &amp;quot;automatically&amp;quot;. The problem is that at the point that the script is executing, there is no div element named &amp;quot;test&amp;quot; because the test div is declared BELOW where the script executes. Putting the script in the window.onload event makes it not execute until all elements are declared.&lt;/p&gt;
&lt;p&gt;NC...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2360574.aspx</link><pubDate>Thu, 15 May 2008 17:41:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2360574</guid><dc:creator>dotdodont</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2360574.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2360574</wfw:commentRss><description>&lt;p&gt;thanks for ALL the responses, I just thought the script would automatically execute anyway. but window.onload does the trick.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;thanks again&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2360392.aspx</link><pubDate>Thu, 15 May 2008 16:16:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2360392</guid><dc:creator>NC01</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2360392.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2360392</wfw:commentRss><description>&lt;p&gt;Ramblor answered this on the first try and the very best way to solve the problem. I have no idea why others feel the need to add posts with basically the same solutions.&lt;/p&gt;
&lt;p&gt;NC...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2360006.aspx</link><pubDate>Thu, 15 May 2008 13:38:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2360006</guid><dc:creator>Dollarjunkie</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2360006.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2360006</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;dotdodont:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Hi All,&lt;br /&gt;&lt;br /&gt;This is really killing me, one of those, no doubt, simple-to-fix-but-I-just-cannot-see-it problems.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;see code below, on page load the script should change the bg color of the element&lt;br /&gt;tried it with td and div, but both return error &amp;#39;Object Required&amp;#39; - but why?? &lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/loose.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Edit Sales People - OFFICE&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;../include/style.css&amp;quot;&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;document.getElementById(&amp;quot;test&amp;quot;).style.backgroundColor = &amp;quot;#FFFFCC&amp;quot;;&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td class=&amp;quot;Light&amp;quot;&amp;gt;Role&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td id=&amp;quot;x&amp;quot;&amp;gt;hello&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;test&amp;quot;&amp;gt;hellow&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Right off the Bat, I am going to say that the reason why is cause at the point where you have the code, when it executes, the text Div has not been created at all and so it does not recognize it. If you place the code in a function and maybe call it later on, it might be the fix you need in this case.&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2359884.aspx</link><pubDate>Thu, 15 May 2008 13:03:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2359884</guid><dc:creator>sanjaysantra</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2359884.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2359884</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;Can you try something like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;div id=&amp;quot;test&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;hellow&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Put the following line inside a JavaScript function:&lt;/p&gt;
&lt;p&gt;function SetBGColor()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;document.getElementById(&amp;quot;test&amp;quot;).style.backgroundColor = &amp;quot;#FFFFCC&amp;quot;;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Just call the function written above&amp;nbsp;as required.&lt;/p&gt;
&lt;p&gt;I hope this may&amp;nbsp;solve your problem.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2359569.aspx</link><pubDate>Thu, 15 May 2008 10:56:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2359569</guid><dc:creator>ramblor</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2359569.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2359569</wfw:commentRss><description>&lt;p&gt;Use this instead:&lt;/p&gt;&lt;p&gt;window.onload=function()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;quot;test&amp;quot;).style.backgroundColor = &amp;quot;#FFFFCC&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;At the moment you&amp;#39;re trying to get a handle to the div before it&amp;#39;s been loaded on the page, so it can&amp;#39;t be found.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Javascript Error: Object Requred - but WHY?</title><link>http://forums.asp.net/thread/2359452.aspx</link><pubDate>Thu, 15 May 2008 10:00:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2359452</guid><dc:creator>dotdodont</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2359452.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=2359452</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;br /&gt;&lt;br /&gt;This is really killing me, one of those, no doubt, simple-to-fix-but-I-just-cannot-see-it problems.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;see code below, on page load the script should change the bg color of the element&lt;br /&gt;tried it with td and div, but both return error &amp;#39;Object Required&amp;#39; - but why?? &lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/loose.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Edit Sales People - OFFICE&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;../include/style.css&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;document.getElementById(&amp;quot;test&amp;quot;).style.backgroundColor = &amp;quot;#FFFFCC&amp;quot;;&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td class=&amp;quot;Light&amp;quot;&amp;gt;Role&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td id=&amp;quot;x&amp;quot;&amp;gt;hello&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;test&amp;quot;&amp;gt;hellow&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>