Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:54

JavaScript error using windows.onerror in Mozilla and Firefo

Poster: fletchsod
Dated: Thursday February 3 2005 - 22:46:31 GMT

When I placed the window.onerror on all web pages for the website before purchasing Milonic. I noticed an increases in javascript error with Mozilla and Firefox.

Andy on the tech support ticket said Milonic scriptswasn't loaded fast enough and he'll have to think of something. I know Andy will find a way in time to come.

Now a few weeks later, I decided to see if there is something I can do about it because I can not wait 6 months or something for a solution, so I'm interesting in hearing what workaround you think can be done until then. I'm open to any ideas or thoughts...

Upon studying the Milonic codes, I found that some functions, variables or arrays were called before it get defined which explained most of the javascript error I got. It remind me of the BASIC language when you use the GOTO looping syntax. So, that make workaround get pretty tough. A rule of thumb is to defined them all before using them. I understand that Gecko browsers executed the codes more quickly than IE, so some get called prematurely but maybe this is not the case here.

I discovered that if I hide the window.onerror, it worked like a charm and the Milonic functionality worked great. It's like nothing is broken. So, that bring me a problem which is that I can't hide the window.onerror because it is needed for things beside the Milonic script. So, I run the JavaScript Console and kept playing around. I found that the webpage never get a javascript error with the Console running. I find that odd too. (with window.onerror activated).

I am wondering if those are possible....

1) Suppress the Milonic errors but accept non-Milonic errors?
2) Rearrange the Milonic codes? This wouldn't make sense because it worked fine without the window.onerror.
3) Delay timer of some sort to prevent the popup() from activating while loading.
4) I dunno what else...


Poster: Andy
Dated: Thursday February 3 2005 - 23:55:47 GMT

Hi fletchsod,

I'm just about to knock-off for the evening, it's almost midnight here now but before I go.... been thinking about your problem.

Anyway, I guess, what we could do is maybe declare a function that runs window.onerror(blah blah blah) but only declare this after the page has finished loading.

In other words, put the window.onerror function in the document.body.onload event. At least that way, the errors for Gecko browsers will be pushed to the JavaScript console rather than to a new page, does this sound feasible?

Food for thought at least - I'm outa here for the night so speak to you tomorrow



Poster: fletchsod
Dated: Friday February 4 2005 - 1:10:09 GMT

Not bad, I'll give this a try on the sample website and see what happen. Will let you all know then...



Poster: fletchsod
Dated: Friday February 4 2005 - 14:52:06 GMT

Nope that doesn't work. It's a good try. Again, I feel not sure if it is something I would want to do because it could prevent non-Milonic scripts from running into an error too. Right now, the browser had crashed after I repeatly tested the script. :roll: :roll:

So, I lost some of the tabbed websites. I'll just fire-up both Firefox and Mozilla and have Firefox to the webs for anything and use Mozilla for script testing for now until then.

Saw in a different forum that someone asked me to try the "try/catch/finally" method. Um, not sure if that can be done...



Poster: fletchsod
Dated: Tuesday February 15 2005 - 16:39:43 GMT

What's the javascript commands for the sleep event? I'm going to put it into the pop_up() function and see how much of a help will it be.

Re: Anyone??

Poster: kevin3442
Dated: Tuesday February 22 2005 - 0:24:03 GMT

fletchsod wrote:
What's the javascript commands for the sleep event? I'm going to put it into the pop_up() function and see how much of a help will it be.

So far as I know, there isn't a js equivalent to sleep. But you might try the js method called setTimeout(). You use it to run a specified function after a specified amount of time (in msecs) following the call to setTimeout(). You'll find documentation here.

Without reviewing all of the earlier issues, I'm not sure what you're going for (been out of the forums for a while). However, some time ago, I wrote a small set of functions for someone who wanted to wait until a menu (the main menu I think) had appeared before doing other things on the page. Don't know if that'll help, but it at least demonstrates one use of setTimeout(). You'll find the discussion here.




Poster: fletchsod
Dated: Thursday February 24 2005 - 13:59:28 GMT

Thanks.. I'll give this a try once I finish up other open items. I have put this Milonic menus on the back burner for now because it's hard for me to have time for everything. I'll let you know how it goes when I get back to it...