PDA

View Full Version : Chrome Menu Null Error



notevenanoob
09-26-2009, 09:29 PM
Hello- I'm working with the Chrome Menu, here...
http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm

It works fine, here...
http://www.healthtek.com/

...but, there is an error in my version of the menu. I have no idea how fix this, or why my version has the error.

Error Line 176: 'document.getElementById(...)' is null or not an object

Any ideas would help, thx.:confused:

jscheuer1
09-27-2009, 10:07 AM
Where you have:


<!-- InstanceBeginEditable name="footscripts" -->
<script type="text/javascript">
cssdropdown.startchrome("chromemenu", "chromemenu2")


swfobject.registerObject("FlashID");

</script><!-- InstanceEndEditable -->

</body>
<!-- InstanceEnd --></html>

Since you only have one menu, you are telling it to look for a non-existent "chromemenu2". Change it to:


<!-- InstanceBeginEditable name="footscripts" -->
<script type="text/javascript">
cssdropdown.startchrome("chromemenu");


swfobject.registerObject("FlashID");

</script><!-- InstanceEndEditable -->

</body>
<!-- InstanceEnd --></html>

notevenanoob
09-28-2009, 05:32 PM
That did the trick. I was hoping it would be something easy.
THX

tmate
08-02-2010, 01:18 AM
Hi John:
i see this post re: null error for chrome is a bit old, but i'm having the same problem with IE (works fine in FF), but I had deleted the second menu from the script so that is not the problem ...

i am getting:

Webpage error details

Message: 'document.getElementById(...)' is null or not an object
Line: 176
Char: 3
Code: 0
URI: http://www.tjmatelson.com/Bear2/chrome.js

page I'm working on:
http://www.tjmatelson.com/Bear2/thelodge.html

I'm stumped
hope you can help me out with this..
thank you
Teri

jscheuer1
08-02-2010, 03:19 AM
Hi John:
i see this post re: null error for chrome is a bit old, but i'm having the same problem with IE (works fine in FF), but I had deleted the second menu from the script so that is not the problem ...

You're right, that's not the problem. There's an error in the HTML markup. Firefox is error correcting it. IE is not. Here it is:


</head>
<body>
<div id="wrapper">
<div id="top"
<div class="chromestyle" id="chromemenu">
<ul>
<li><a href="reservations.html">Reser . . .

See? No closing > for that div tag. It should be:


</head>
<body>
<div id="wrapper">
<div id="top">
<div class="chromestyle" id="chromemenu">
<ul>
<li><a href="reservations.html">Reser . . .

tmate
08-02-2010, 01:44 PM
John Scheuer found the problem....

<div id="top"


notice anything?
yep... a missing closing carrot...
darn.

many thanks to John:cool: