By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,700 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,700 IT Pros & Developers. It's quick & easy.

IE: Object expected; Moz: runs fine

P: n/a
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
http://www.heuveltop.nl/BasCB

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <bv***********@news2.solcon.nl>, ba*@heuveltop.org
enlightened us with...

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

Jul 20 '05 #2

P: n/a
kaeli wrote:
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.
--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Jul 20 '05 #3

P: n/a
In article <c0**********@news2.solcon.nl>, ba*@heuveltop.org enlightened
us with...

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.
--
--
~kaeli~
Can you be a closet claustrophobic?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.