IE: Object expected; Moz: runs fine

B

Bas Cost Budde

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

kaeli

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?

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!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 
B

Bas Cost Budde

kaeli said:
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*)

<grin>

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.

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

kaeli

[email protected] enlightened said:
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.

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.


--
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top