Random bug with MSIE6 & mmenudom.js & nested <scr

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Random bug with MSIE6 & mmenudom.js & nested <scr

Post by cmanley »

Hi,
I'm evaluating this nice menu system in a test site to see if it's suitable before buying any licences. All's going well in Firefox, Opera, and MSIE6 except for this:

In about 1 out of 5 refreshes of the site in MSIE6 a javascript error occurs that I can't debug because it's in an anonymous function (or so the debugger says). I've minimized the javascript being used and left the menus out and found that it occurs only when this line is included:
<script type="text/javascript" src="menu/mmenudom.js"></script>
... and when nested deep inside the page this line is included:
<script type="text/javascript"><!-- // if I remove this script block then no errors occur //--></script>

It is so weird because without that empty script block the error never occurs. This smells like it's got something to do with a timer and with walking the DOM tree. I suspect therefore that it's caused by code that injects the MILONIC text into the menu.

Try it for yourself to find out... just remove that script block and no more errors occur.

This site is here (but will change soon as it's in development):
http://bioreform.ath.cx/
It's validated xhtml 1.1.
No script errors ever occur in Firefox and Opera.

Please help...
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Causes and solution found

Post by cmanley »

Hi,
I found a solution to the bug.
It occurs when you use MSIE6, mmenudom.js, and a <script>..</script> block anywhere below a table row element that has a calculated height using the MSIE specific css command 'height: expression(...)'. My expression contains references to different elements in the page using getElementById(...). Somehow without the combination of all 3 of the bug's requirements mentioned above, the expression is evaluated after the elements have been created by the browser. If all 3 of the bug's requirements are met, then in about 1 in 5 browser refreshes, the css height expression is evaluated before the elements it references have been created.
The solution is to use javascript to set the expression at the bottom of the body or in a onload handler.

Really weird!
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi,-
I don´t understand, maybe you´ll provide an explanation, but which application requires the use of the Milonic files without a menu_data.js and instead of that an empty, as you say "<script>..</script> block anywhere below a table row element that has a calculated height using the MSIE specific css command 'height: expression(...)'. ".... ??
I found a solution to the bug.
what but ? Bug of IE6 ? A Milonic menu-systems bug ?

Michael
benwalsh
Beginner
Beginner
Posts: 2
Joined: Tue Apr 18, 2006 10:46 pm

Post by benwalsh »

so this "bug" will only occur if the 'height: expression is used, I think this clears us.
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Post by cmanley »

benwalsh wrote:so this "bug" will only occur if the 'height: expression is used, I think this clears us.
uhh no, it'll occur only when all 3 of the requirements I mentioned are present. It's weird but not important anymore as I've solved the problem.
cmanley
Advanced
Advanced
Posts: 12
Joined: Sat May 13, 2006 3:35 am

Post by cmanley »

Migru wrote:Hi,-

what but ? Bug of IE6 ? A Milonic menu-systems bug ?

Michael
I've got no idea where the 'bug' is in because I can't read and debug the source code. It's only the combination of 3 seemingly unrelated things that causes it to occur.
Post Reply