<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'document.getElementById(' ') is null error' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'document.getElementById(' ') is null error' posted on the 'PHP' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 20:13:50 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 20:13:50 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>document.getElementById(' ') is null error</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/410232/410232/documentgetelementbyid--is-null-error/</link>
      <description>Hello,&lt;br /&gt;
i got an error on my php page.my code is bellow.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
$year = $_GET['year'];&lt;br /&gt;
$month = $_GET['month'];&lt;br /&gt;
$day = $_GET['day'];&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;
function GetCount(y,m,d){&lt;br /&gt;
	        &lt;br /&gt;
               /* Here is some logic and get output on 'out'. */&lt;br /&gt;
&lt;br /&gt;
                out = "some result";&lt;br /&gt;
		document.getElementById('countbox').innerHTML=out;&lt;br /&gt;
		&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type="text/javascript" &amp;gt;&lt;br /&gt;
GetCount('&amp;lt;?php echo $year; ?&amp;gt;','&amp;lt;?php echo $month; ?&amp;gt;','&amp;lt;?php echo $day; ?&amp;gt;'); &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id="countbox"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and bellow is my url.&lt;br /&gt;
&lt;br /&gt;
countdown.php?year=2009&amp;amp;month=12&amp;amp;day=19&lt;br /&gt;
&lt;br /&gt;
in this code i got an javascript error."document.getElementById('countbox')is null".&lt;br /&gt;
please help me.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/410232/410232/documentgetelementbyid--is-null-error/</guid>
      <pubDate>Thu, 03 Dec 2009 00:48:02 -0700</pubDate>
      <category>PHP</category>
    </item>
    <item>
      <title>Re: document.getElementById(' ') is null error</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/410232/410419/re-documentgetelementbyid--is-null-error/#410419</link>
      <description>The code is ran before countbox is initialized. You need to run it after the page has loaded.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&amp;lt;script type="text/javascript" &amp;gt;
function DoGetCount()
{
  GetCount('&amp;lt;?php echo $year; ?&amp;gt;','&amp;lt;?php echo $month; ?&amp;gt;','&amp;lt;?php echo $day; ?&amp;gt;');
}
window.onload=DoGetCount;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/410232/410419/re-documentgetelementbyid--is-null-error/#410419</guid>
      <pubDate>Sun, 06 Dec 2009 12:19:21 -0700</pubDate>
      <category>PHP</category>
    </item>
    <item>
      <title>Re: document.getElementById(' ') is null error</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/410232/411331/re-documentgetelementbyid--is-null-error/#411331</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
       anthrax11 is right. Your code is running before the initialization the countbox. First you declare the variable and then declare the values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Olivia&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.newtonit.co.uk/"&gt;Web Security &amp;amp; Video Conference UK&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/410232/411331/re-documentgetelementbyid--is-null-error/#411331</guid>
      <pubDate>Tue, 29 Dec 2009 00:45:23 -0700</pubDate>
      <category>PHP</category>
    </item>
  </channel>
</rss>