473,509 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can a jsp file in an IFrame calls a javascript function outside of the IFrame

7 New Member
Hi:

I am using IE 6 SP2.
My resize attribute does not work <body onresize="test1();">.
When I resize my window, the resize event doesnot get call.

I have a jsp page with an iFrame called test1.jsp. The iFrame src points to a page called test2.jsp. It has a resize
attribute that calls a javascript function that is located in test1.jsp.
In the test2.jsp page, it doesn't recognize the function that is located in test1.jsp page. Is there anyway to do this.

test1.jsp:

<html>
<head>
<script type="text/javascript">
function test1()
{
alert("test1.jsp");
}

function test3()
{
alert("test3, called from test2.jsp but code locate at test1.jsp");
}
</script>
</head>

<body onresize="test1();">
This is page 1.
<iframe src="http://localhost:7001/test2/test2.jsp" id="dataFrame" style="height:942.0px;width:100%" scrolling="YES" frameborder="1"></iframe>

</body>
</html>
test2.jsp:
<html>
<head>
<script type="text/javascript">
function test2()
{
alert("test2.jsp");
}
</script>
</head>

<body onresize="test2();test3();">
This is page 2.

</body>
</html>
If the above is not possible, is there another way to capture the event when a popup window is resize or maximize or mimize.
I tried <body onresize="test1();"> it doesn't work. I event tried:
window.onresize=test1 and it doesn't work.

I tried <body onmove="test1();"> It partially works. When I miminize the popup window it triggers the event but when I maximize the popup
window from a smaller popup window it doesn't trigger an event.

Any hint or help or direction to an url would be greatly appreciated.

Yours,

Frustrated.
May 31 '07 #1
1 3905
shoonya
161 New Member
try putting all the javascript functions in another .js file and include that file in both th pages
Jun 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
8067
by: Troy | last post by:
Hi! I am working on a rather complicated set of html and javascript files here and am experiencing some serious IE/Netscape(Mozilla actually) incompatability issues. I have an html page that...
6
9359
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
18
43515
by: Chris Ianson | last post by:
Hi geniuses (or is that genii, or genies) The challenge is as above really. I have a page with an iframe in it, and need to call a JS function in the *parent* page, *from* inside the iframe. ...
3
7144
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried...
1
14057
by: Anil | last post by:
Hello, In line 8 below, I am trying to set the content of the iframe, but receive an error. Movie 2 plays normally. Movie 1 fails. This example is from the QuickTime docs. (example...
1
2710
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the...
4
3838
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
5
2263
by: iuniamadalina | last post by:
Hi! i have a html page with a iframe. I want to be able to select some text from iframe and when i push a button outside the iframe the selected tet shoul be copied in a text field ( the text field...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.