IE: Object expected; Moz: runs fine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bas Cost Budde

    #1

    IE: Object expected; Moz: runs fine

    I have a html document, in which I include two standard libraries of
    functions (supposed to help me with cross browser issues), and one
    application-specific script file. All Javascript fcoz.

    The very first attempt at invoking a function from this last script file
    fails miserably in IE (6) but works as it should in Moz (1.4)

    I have tried putting alert()s here and there, so I (think I) can tell
    the exact spot where IE dies.

    Structure is like this (all in HEAD):

    <script type="text/javascript" src="../libPlatform.js" ></script>
    <script type="text/javascript" src="../libDOM.js"></script>
    <script type="text/javascript" src="tooltip.js "></script>
    <script type="text/javascript">

    function register() {
    initAPI();
    alert('after init');
    regTooltip('a1' );
    alert('after dreg-1');
    regTooltip('a2' );
    }
    </script>

    initAPI sits in libPlatform, and executes. I get to see the first alert.
    And then, boom, IE script errors on page: Object expected (points to
    'regTooltip')

    Am I missing something here? If my code is wrong, why is Mozilla so
    forgiving about it? How can I persuade IE to get the function?

    Note: if I put regTooltip() right above register(), so locally in the
    document, it works.
    --
    Bas Cost Budde


  • kaeli

    #2
    Re: IE: Object expected; Moz: runs fine

    In article <bvu89c$6ak$16@ news2.solcon.nl >, bas@heuveltop.o rg
    enlightened us with...[color=blue][color=green]
    >>[/color]
    > Am I missing something here? If my code is wrong, why is Mozilla so
    > forgiving about it? How can I persuade IE to get the function?
    >[/color]

    It's really hard to guess without the rest of the code.
    Do you have a URL with a functioning (or malfunctioning, if you prefer
    *LOL*) test page you can show us so we can see all the code? Posting it
    all here would be rather large for Usenet, I'd gather.

    --
    --
    ~kaeli~
    If that phone was up your a$$, maybe you could drive a
    little better!



    Comment

    • Bas Cost Budde

      #3
      Re: IE: Object expected; Moz: runs fine

      kaeli wrote:
      [color=blue]
      > It's really hard to guess without the rest of the code.
      > Do you have a URL with a functioning (or malfunctioning, if you prefer
      > *LOL*)[/color]

      <grin>

      test page you can show us so we can see all the code? Posting it[color=blue]
      > all here would be rather large for Usenet, I'd gather.[/color]

      In the process of creating such a page I came across two function
      declarations with the same function name.

      Stupid. That is, on hindsight. <looks around> who said I was stupid? ;-)

      Thanks for providing the different view I needed.
      --
      Bas Cost Budde


      Comment

      • kaeli

        #4
        Re: IE: Object expected; Moz: runs fine

        In article <c00ral$ft3$1@n ews2.solcon.nl> , bas@heuveltop.o rg enlightened
        us with...[color=blue]
        >
        > In the process of creating such a page I came across two function
        > declarations with the same function name.
        >
        > Stupid. That is, on hindsight. <looks around> who said I was stupid? ;-)
        >
        > Thanks for providing the different view I needed.
        >[/color]

        You're welcome.
        And that's one of the biggest reasons we advocate doing that - making
        small test pages that illustrate the problem. They often catch these
        kinds of errors. They can catch typos and stuff, too.


        --
        --
        ~kaeli~
        Can you be a closet claustrophobic?



        Comment

        Working...