jamie
Oct 19 2005, 12:28 PM
DMB version 4.10.002
I noticed something strange using the JavaScript console in Firefox. If you open it (Tools > JavaScript Console) and view the Warnings section, it is loaded with warnings from my DMB iemenu.js file. There are 4 warnings, that repeat over and over again:
Warning: reference to undefined property tb.left Source File: file:///K:/Work/Menu%20System/menu/iemenu.js Line: 1
Warning: reference to undefined property tb.width Source File: file:///K:/Work/Menu%20System/menu/iemenu.js Line: 1
Warning: reference to undefined property tb.top Source File: file:///K:/Work/Menu%20System/menu/iemenu.js Line: 1
Warning: reference to undefined property tb.height Source File: file:///K:/Work/Menu%20System/menu/iemenu.js Line: 1
If I click "clear" to wipe out the errors, they fill the page again, almost as if there is a JS function that is in a never ending loop. I'd like to get rid of these warnings, as they are making the javascript console unusable in my application. I rely on the console to troubleshoot JS errors in my web based app, and with these errors, it makes it impossible to get at any other JS errors from my app that might occur.
I am not 100% certain, but I think this problem started when I upgraded to version 4.10. I have older versions of the same menu that do not have this problem.
Any ideas on how I can rid of these errors?
Hywel
Oct 19 2005, 12:46 PM
Could you post a URL to your site, please? Source code is handy when debugging.
jamie
Oct 19 2005, 01:07 PM
Hywel
Oct 19 2005, 04:39 PM
This is the error I get when the page loads:
CODE
Error: document.getElementById("data_div") has no properties
Source File: http://www.squirrelcart.com/admindemo/squirrelcart/
Line: 870
Is there an element called "data_div"? I couldn't find one in the source code.
jamie
Oct 19 2005, 05:11 PM
That div is not always present. It sounds like the div was referenced in JS without it being on the page. I can't recreate that error in IE or Firefox. That particular div is not part of the menu, so let's remove it from the equation. I uploaded a test menu that contains nothing but the menu code, so you can see it without anything else impacting the JS:
http://www.squirrelcart.com/menu_test/The file you are seeing is the default "example_menu.htm" file from DMB renamed to "index.htm".
Hywel
Oct 19 2005, 05:39 PM
Now I don't get any errors until I select a link, then I get "SID_URL is not defined".
jamie
Oct 19 2005, 05:44 PM
The warnings I'm getting are only visible in the Javascript console in FF (and most likely Mozilla), and occur after the page is loaded. You don't need to click any links to get them. The menu links will not work as the menu has been isolated to demonstrate the JS warnings that occur.
To view the errors:
1. Open Firefox
2. Go to the URL above
3. Click "Tools > JavaScript Console"
4. Click the "Warnings" button (if you aren't already on that section by default)
The Javascript console will only show JS errors that occurred since the last time it was cleared. If you click "clear", you can see that the page will just refill with more warnings, even though you did not reload or click anything on the page. This is most likely due to some JS that is running in a loop, and never ends after the page loads.
Hywel
Oct 20 2005, 03:43 AM
I know how to use the console. There are no warnings in it when I use it - just the one error referring to SID_URL.
The JS console is also "live" in that new warnings or errors are appended to the end or the list.
Have you tried compiling and installing the menu with zero compression? That way you'll get a .js file that is readable.
I've pretty-printed the code and see that the tb object is only referenced in a function called "ScrollTB", and the function is only called once. Is that linked, perhaps, to pinning the toolbar at the top of the window when the page scrolls? What happens if you disable that?
I'm using FF1.0.7.
jamie
Oct 20 2005, 12:04 PM
Sorry about that...didn't realize you saw that in the console. Thanks for the advice. I didn't realize you could get DMB to not compress the JS.
I think this problem may be specific to the computer I'm on. I'm using FF 1.0.7 as well. I just installed 1.0.7 on another computer, and it is not showing the same warnings. I've removed all my extensions, reinstalled Firefox, and it does the same thing on this computer. I'll keep trying to eliminate it and let you know if I find the cause.
jamie
Oct 20 2005, 12:40 PM
It looks like the problem had something to do with information in "C:\Documents and Settings\MyUser\Application Data\Mozilla". I uninstalled, removed everything from that folder, reinstalled, and it's fine now.
Thanks for the help!
Hywel
Oct 20 2005, 12:56 PM
No problem. Darn configuration files!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.