[Javascript] document.getElementById has no properties

Vinayakam Murugan mvinayakam at gmail.com
Tue Sep 20 20:27:37 CDT 2005


Hi

The problem got resolved. I put the appendchild code in the onload event of 
body and it worked.

Thanks for your help.

On 9/20/05, Triche Osborne <wdlists at triche-osborne.com> wrote:
> 
> Vinayakam Murugan wrote:
> > Hi
> >
> > I am trying to append a preloaded image to a tag. It is giving me the
> > following error
> >
> > Error: document.getElementById("bottomback") has no properties
> > Source File:
> > 
> http://192.168.100.11/app_dir/layout/preload.php?Language_Id=01&Class_Id=first
> > Line: 63
> >
> > ------------------------------------------
> > <a id="bottomback" name="bottomback" class="back" href="<?echo
> > $Back_Link?>;showmouse();"></a>
> >
> > <script type="text/javascript">
> > document.getElementById("bottomback").appendChild(top.bottombar
> > [1][<?=$Language_Id?>]);
> > </script>
> >
> I tested this twice, once with a child SPAN I made up and once with your
> URL query but without (obviously) your image array.
> 
> The first test looked like this:
> document.getElementById("bottomback").appendChild(newSpan);
> 
> It successfully attaches the span to bottomback.
> 
> The second test worked as I expected, returning the error message
> "top.bottombar has no properties". It writes out the following script
> source code:
> document.getElementById("bottomback").appendChild(top.bottombar[1][01]);
> 
> Neither of these tests refuses to recognize bottomback itself. (Though
> unless your PHP is printing more than just a URL there, that showmouse()
> function is out of place.)
> 
> Since the SPAN attached just fine, recheck the code that you're using to
> create the top.bottombar array to be sure there's something there. Also,
> be sure that you are recognizing 01 in the second dimension, not just 1.
> 
> Triche
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 



-- 
Warm Regards
~~~~~~~~~~~~~~~
Vinayak
http://theregoesanotherday.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050921/a03dbed3/attachment.htm>


More information about the Javascript mailing list