Forum Moderators: phranque

Message Too Old, No Replies

JavaScript undefined error

onmouseover event triggers child function

         

nlmark

11:38 am on Oct 15, 2003 (gmt 0)

10+ Year Member



I've got a page with structure:

<html>
<head ... /head>
<body>
<script ...><!--
document.onmouseover = childframe.targetfunction;
//--></script>
<iframe name="childframe"></iframe>
</body></html>

Error: undefined 'childframe'

Any solution?

Alternative Future

11:44 am on Oct 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

<html>
<head ... /head>
<body>
<script ...><!--
document.onmouseover = getElementById('childframe').targetfunction;
//--></script>
<iframe id="childframe"></iframe>
</body></html>

Should do the trick!

hth,

-gs

nlmark

9:01 pm on Oct 15, 2003 (gmt 0)

10+ Year Member



Error: Object Expected

:S :'(

MonkeeSage

12:31 am on Oct 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not an error with AF's code...that's how JavaScript works...

You are assigning onmouseover to a function called "targetfunction", which is supposed to be a member of "childframe." That's the 'object' it is expecting.

What exactly are you wanting to accomplish with this script?

Jordan

nlmark

1:54 pm on Oct 16, 2003 (gmt 0)

10+ Year Member



Still doesn't work. I want that a pop-up menu disappears. It usually does, but when I rapidly move my menu off the iframe, it doesn't trigger the iframe hideMenu function, so the parent should trigger it. But it won't, cause of this error.

MonkeeSage

10:14 pm on Oct 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<html>
<head ... /head>
<body>
<script ...><!--
document.onmouseover = window.frames['childframe'].targetfunction;
//--></script>
<iframe id="childframe" name="childframe"></iframe>
</body></html>

Jordan