FireFox & JavaScript acts mysterious

D

david

I have a picture and it has onclick event, with invokes JavaScript
function called ModuleManager(); Then it saves a copy of Node (Blocks,
which is DIV) it tmp_blocks['Blocks'] with all children elements. And
it changes Blocks innerHTML with new one, which has form and after I
press button which has onclick too and calls another function which
Blocks innerHTML sets to tmp_blocks['Blocks'];

But after that(when I want to press image again) FireFox says:
Error: ModuleManager is not a function
Source File: http://localhost/admin/
Line: 1

But, Safari, Opera, IE 7 and all other works just fine with 0 errors.
Any ideas why FireFox acts like this?

And one more thing, if I invoke function myself by writing
"javascript: ModuleManager();" it works perfectly.

All functions are in JS file.

Thanks for help.
 
E

Evertjan.

david wrote on 08 jul 2007 in comp.lang.javascript:
I have a picture and it has onclick event, with invokes JavaScript
function called ModuleManager(); Then it saves a copy of Node (Blocks,
which is DIV) it tmp_blocks['Blocks'] with all children elements. And
it changes Blocks innerHTML with new one, which has form and after I
press button which has onclick too and calls another function which
Blocks innerHTML sets to tmp_blocks['Blocks'];

But after that(when I want to press image again) FireFox says:
Error: ModuleManager is not a function
Source File: http://localhost/admin/
Line: 1

But, Safari, Opera, IE 7 and all other works just fine with 0 errors.
Any ideas why FireFox acts like this?

And one more thing, if I invoke function myself by writing
"javascript: ModuleManager();" it works perfectly.

All functions are in JS file.

Do you think we can comment on a function you did not show to us?

Did you try any form of debugging?
 
D

david

I thought that the problem could be with how I change back Blocks
innerHTML, so I decided just to use replaceChild, but it didn't help
me, the same problem. So, what makes FireFox to ignore my function at
all.
 
M

Martin Honnen

david said:
But after that(when I want to press image again) FireFox says:
Error: ModuleManager is not a function
Source File: http://localhost/admin/
Line: 1

But, Safari, Opera, IE 7 and all other works just fine with 0 errors.
Any ideas why FireFox acts like this?

You have a function and an element named ModuleManager so there is
likely to be a naming conflict, I guess Firefox has the form
ModuleManager in its scope chain, not the function you are trying to
call. Call the function with
window.ModuleManager()
and the problem will likely go away.

That is just a guess, you need to show us where/how exactly the function
is being called and how the HTML elements are nested and how the event
handlers look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top