Gossamer Forum
Home : General : Perl Programming :

Javascript Question

Quote Reply
Javascript Question
Hi,

I'm having some problems with javascript/frames when trying to get a function to load from one frame into another. I'll outline the problem below...

- have got a frameset.
- have got a javascript function in frames[2] called init
- init returns a value
- am trying to call the javascript function in frames[2] from frames[0], and display the result.

In netscape it works fine, but in IE it returns the result back into frames[2] instead of being in frames[0] - the frame I'm calling it from.

There is one odd thing about it - I can test it with another simple function and it returns the result fine in both browsers using this in the body...

<SCRIPT LANGUAGE="JavaScript">
document.write(parent.frames[2].testing());
</SCRIPT>

But when I change the function above to call init() instead it returns 'undefined'.

Not sure why it would be undefined in one browser and not the other - anyone have any ideas?

Cheers,
Regan.

Last edited by:

ryel01: Oct 28, 2001, 1:53 PM
Quote Reply
Re: [ryel01] Javascript Question In reply to
In Reply To:
Not sure why it would be undefined in one browser and not the other

My personal experience has been the other way around, where IE ignores most errors and Netscape absolutely FREAKS OUT at the slightest bit of misplaced syntax. The thought of using javascript across frames gives me the heebejeebies <shudder>. Not that it is impossible, it's just that I don't understand it.

Anyway... if you don't find an answer here check out 'javascript.internet.com' where I've had good luck using their support forum in the past.

Good Luck, -Mike.