How do call a function from inside an iframe?

P

Paul

HI! I need to call a function that is located in the parent. I need it so
that it calls when the child page in the iframe loads.

Would it be better to use an onload event in the body? if so how do I call
it from the child page?
 
J

Jon Spivey

Hi,
Onload fires when the whole page (including iframes) has loaded. You'd put
the function call in the body of the parent page, eg
<body onload="someFunction();">
 
A

ASM

Paul said:
HI! I need to call a function that is located in the parent. I need it so
that it calls when the child page in the iframe loads.

Would it be better to use an onload event in the body? if so how do I call
it from the child page?

in the child page :

<body onload="parent.myFunction()">
 
P

Paul

HI! Thanks, I will try it. :)

Paul

Jon Spivey said:
Hi,
Onload fires when the whole page (including iframes) has loaded. You'd put
the function call in the body of the parent page, eg
<body onload="someFunction();">
 
P

Paul

HI! I want to simulate resizing the parent page page by using this function.

<script language="JavaScript">
function firefoxautofix(x,y,){
parent.window.resizeBy(-1,-1)
parent.window.resizeBy(+1,+1)
}
</script>

Should this function be in the head or the body?

I want to get around a small bug in firefox that does not seem to resize (
after a iframe resize script is executed) the body unless the user refreshes
the page or resizes the browser manually from left to right. So I figure
that I would try to simulate a manual resize with this script.

Would I just call it like so.

<body onload="firefoxautofix();">
 
A

ASM

Paul said:
HI! I want to simulate resizing the parent page page by using this function.

<script language="JavaScript">
function firefoxautofix(x,y,){
parent.window.resizeBy(-1,-1)
parent.window.resizeBy(+1,+1)
}
</script>

Should this function be in the head or the body?

I want to get around a small bug in firefox

is it really a bug ?
thought on validate conventions an iFrame can't be resized ?
that does not seem to resize (
after a iframe resize script is executed) the body unless the user refreshes
the page or resizes the browser manually from left to right. So I figure
that I would try to simulate a manual resize with this script.

Would I just call it like so.

<body onload="firefoxautofix();">

you're joking ?
 
R

Ronx

Note that firefox has an option setting to disable scripts that resize
the browser - I believe this is the default setting.
In FireFox: Tools->Options->Web Features - Advanced button
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top