Null error in Javascript

Document.getElementById("VideoLayer") is

Page 1 of 1

0 Replies - 1244 Views - Last Post: 03 February 2009 - 05:40 AM

#1 EvolutionMedia   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Null error in Javascript

Post icon  Posted 03 February 2009 - 05:40 AM

Haven't been on this site for a while! Missed ya guys! :)

Anyways, I created a php script file that outputs html file. However, that's not that main problem. So, I downloaded a tab script from that uses an external html file to read the contents of the subtabs.

I written a javascript function but now it's saying document.getElementById("VideoLayer") is null. I erased the cache from FF and reloaded it. Same thing.

Here's a sample of the function:


<script language="Javascript">
function PickVideo(vid) {

if(vid == 'MakemeBad35') {

document.getElementById("VideoLayer").innerHTML = "Testing";

As you can see it's in the Body. So that shouldn't be the problem. Now when it comes to the tabs I have this:

<div id="mytabsmenu" class="tabsmenuclass">
<li><a href="" rel="gotsubmenu[selected]">Javascript Kit</a></li>
<li><a href="" rel="gotsubmenu">CSS Drive</a></li>
<li><a href="">No Sub Menu</a></li>

<div id="mysubmenuarea" class="tabsmenucontentclass">

<!--1st link within submenu container should point to the external submenu contents file-->
<a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a>
	<div id="VideoLayer" style="visibility:hidden">
<div id='vu_ytplayer_vjVQa1PpcFMLwjVLggLrsEitwHc53sIBQEc_dP_HF1c='>
<a href=''>Watch the latest videos on</a>

<script type='text/javascript' src=''>


<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true)


Inside a Table Column. Watch i bet it jumps out in my face. Everything looks fine. However, maybe the Video Layer is defined in another DIV which is causing a few hiccups. What u think?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1