473,414 Members | 1,675 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Call JScript Function in iFrame - FireFox Issue

Hi I have the following simple page:

<HTML>
<TITLE>Test</TITLE>
<HEAD>
<script language="javascript">
function doSubmit()
{
alert('test');
window.frames.item(0).updateParent();
}
</script>
</HEAD>

<body>
<table cellpadding="1" cellspacing="1" >
<tr>
<td rowspan="24" valign="top">
<IFRAME id="iTreeView" name='tree' src="iFrame_Child.htm"
width="324" height="550" scrolling="auto" frameborder="1"
marginheight=2 marginwidth=2 ></IFRAME>
</td>
</tr>
</table>
<table>
<form action="" method="POST" name="frmRequest">
<tr>
<td align=center><input type="button" OnClick="javascript:doSubmit"
value="Submit It"></td>
</tr>
</table>
</form>
</BODY>
</HTML>

<!----------------------------Respective Child
Page--------------------------------->

<html>
<head>
<title>iFrame Test</title>
<script>
function updateParent()
{
alert('In updateParent');
}
</script>
</head>
<body onload=updateParent()>
</body>
</html>
When the page loads, the updateParent function fires off (w/in iFrame),
but the button click event doesn't fire the function off. What am I
doing wrong?

This works fine in IE, but not in FireFox. I am using IE7 Beta 3 and
FireFox 1.5.0.6

Thanks in advance for any input!

Aug 3 '06 #1
2 15788


co**@b-50.com wrote:

window.frames.item(0).updateParent();
The frames collection is underspecified and dating back from DOM Level
0, it does not have an item method, at least not in Mozilla/Firefox.
Simply use
window.frames[0].updateParent();
or
window.frames.tree.updateParent();

<IFRAME id="iTreeView" name='tree' src="iFrame_Child.htm"
width="324" height="550" scrolling="auto" frameborder="1"
marginheight=2 marginwidth=2 ></IFRAME>
<td align=center><input type="button" OnClick="javascript:doSubmit"
value="Submit It"></td>
<input type="button" onclick="doSubmit();"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 3 '06 #2
OMG - what a simple fix. You RULE!!!!!!!!!!!!!!! Thank you very
much!!!!!!!!!!!!!!!!!!!!!!!
Martin Honnen wrote:
co**@b-50.com wrote:

window.frames.item(0).updateParent();

The frames collection is underspecified and dating back from DOM Level
0, it does not have an item method, at least not in Mozilla/Firefox.
Simply use
window.frames[0].updateParent();
or
window.frames.tree.updateParent();

<IFRAME id="iTreeView" name='tree' src="iFrame_Child.htm"
width="324" height="550" scrolling="auto" frameborder="1"
marginheight=2 marginwidth=2 ></IFRAME>

<td align=center><input type="button" OnClick="javascript:doSubmit"
value="Submit It"></td>

<input type="button" onclick="doSubmit();"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Christian Radermacher | last post by:
I have document with an iframe in it. I'm able to call a javascript function in the main-document from the javascript inside the iframe-document. I have difficulties to do the other way round,...
4
by: nec | last post by:
Hi, I'm having trouble calling a function thats located in a iFrame from the parent. Shortly, i can't figure out the location in DOM. In IE it works fine with a simple line of...
2
by: moondaddy | last post by:
I'm using vb.net and have an aspx page where I want to call a function in the code behind to do something on the backend and I want to call this function from a jscript function in the aspx page. ...
18
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. ...
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
4
by: ashkash | last post by:
I am trying to implement a customer survey into our webpages. The survey consists of a javascript file which launches an html file in an iframe. When the user meets certain parameters defined in the...
4
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.