FireFox & JavaScript acts mysterious

Discussion in 'Javascript' started by david, Jul 8, 2007.

  1. david

    david Guest

    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.
     
    david, Jul 8, 2007
    #1
    1. Advertising

  2. david

    Evertjan. Guest

    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?


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jul 8, 2007
    #2
    1. Advertising

  3. david

    david Guest

    david, Jul 8, 2007
    #3
  4. david

    david Guest

    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.
     
    david, Jul 8, 2007
    #4
  5. david wrote:

    > 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.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jul 8, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Art Werschulz
    Replies:
    0
    Views:
    677
    Art Werschulz
    Dec 3, 2003
  2. Joe Fallon
    Replies:
    1
    Views:
    438
    Peter Blum
    Feb 15, 2004
  3. Mark Goldin

    Web control that acts as a xml data island

    Mark Goldin, Apr 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Ken Cox [Microsoft MVP]
    Apr 29, 2004
  4. Replies:
    1
    Views:
    320
    Gopal \(FMS, Inc.\)
    Feb 8, 2005
  5. Nathan Sokalski
    Replies:
    1
    Views:
    9,132
    Peter Blum
    Jun 29, 2005
Loading...

Share This Page