473,770 Members | 6,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call JScript Function in iFrame - FireFox Issue

Hi I have the following simple page:

<HTML>
<TITLE>Test</TITLE>
<HEAD>
<script language="javas cript">
function doSubmit()
{
alert('test');
window.frames.i tem(0).updatePa rent();
}
</script>
</HEAD>

<body>
<table cellpadding="1" cellspacing="1" >
<tr>
<td rowspan="24" valign="top">
<IFRAME id="iTreeView" name='tree' src="iFrame_Chi ld.htm"
width="324" height="550" scrolling="auto " frameborder="1"
marginheight=2 marginwidth=2 ></IFRAME>
</td>
</tr>
</table>
<table>
<form action="" method="POST" name="frmReques t">
<tr>
<td align=center><i nput type="button" OnClick="javasc ript: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=updatePa rent()>
</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 15799


co**@b-50.com wrote:

window.frames.i tem(0).updatePa rent();
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.t ree.updateParen t();

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

--

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.i tem(0).updatePa rent();

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.t ree.updateParen t();

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

<td align=center><i nput type="button" OnClick="javasc ript:doSubmit"
value="Submit It"></td>

<input type="button" onclick="doSubm it();"

--

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
94261
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, i.e. to call a function in the iframe-document from javascript in the main-document. TIA Christian
4
3637
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 window.contens.alerter('wassa?'), but it doesnt, of course work in Firefox (0.8). I've tried document.getElementById('contens').alerter('wassa?') and
2
3050
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. Furthermore I know there will be a postback involved but the state of the page will not change at all so I would like it to be as efficient as possible with no appearance to the user that anything happened. I saw in someone else's code where...
18
43566
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. (It's for Google Maps, but I won't bore you with the complexities of that, as it doesn't affect the question). Mochas kudos to anyone able to solve this widdle.
1
8033
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 flash window comes above the iframe area the html links stop working. Yet the links remain active when the flash window is outside the iFrame area. This problem is coming in Firefox, but running fine in IE. If anybody has any solution, please...
4
22584
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 js file it launches the iframe. This works fine in Firefox and the iframe is launched perfectly. In IE this does not work at all. When the iframe is supposed to be launched the page goes blank. It does not even continue to load the web page and seems...
4
3875
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 am using a master page senerio. The erro I'm getting is 'busyBox' is not a member of 'ASP.login2_aspx'
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
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 we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.