473,770 Members | 5,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make the iframe's to call my function remotely?

40 New Member
i am trying to disable some of the anchor tags which are linked with particular onmouseover and onmouseout events.i have written a javascript function.when i called this function on load of the document body, it is able to disable the tags.But when the body of the page has iframes, this script is unable to disable the tags with in the iframes. since "document.getel emetbytags" is not returning the anchor tags with in the iframe.so i need to put this script in the iframe source file and i need to call this function on load of the body of the iframe. since my site has so many iframes i would need to repeat this task so many times.

Without even including the script in the iframe source file, and the below code on all the iframe tags,

onload=javascri pt:linkdisablin g function();

is there any way to make the iframes to call and access this function onload ?

please notify me if my question is unclear .
Feb 15 '09 #1
6 2633
gits
5,390 Recognized Expert Moderator Expert
in your iframe's onload just call something like that:

Expand|Select|Wrap|Line Numbers
  1. parent.disable_my_nodes(document);
  2.  
so just pass the document to the function and note that the shown example works when the iframe is a direct child of your document ... otherwise you may use top or parent.parent for example.

kind regards
Feb 15 '09 #2
Revathi Balakrishnan
40 New Member
This code works very well, Thanks alot for the reply.

but i still have a probelm in implementing this.
My Web site has large number of iframes, and the content of the iframe starts in one file and ends in another file,so inserting a body tag and an onload method in the body tag becomes a bit difficult. hence i thought of inserting the below javascript to all my iframes , but it does not work.
Expand|Select|Wrap|Line Numbers
  1.   <script type="text/javascript">
  2.              document.body.onLoad = link disabling_function (document) {
  3.                 function body
  4.             }
  5.         </script>
  6.  
help me to spot the problem in this script.
Is there any other way to make this function to be called onload of the iframe content.
Feb 16 '09 #3
gits
5,390 Recognized Expert Moderator Expert
i don't get it ... could you give a simplified example for the structure you are using? one page, one iframe with it's example content, and how yuo use the javascript code in it? this should make it clear where the problem would be.

kind regards
Feb 16 '09 #4
Revathi Balakrishnan
40 New Member
To make my iframe to access my javascript function i thought of inserting the below tag in my iframes.
<body onload="link disabling_funct ion (document) ;">
</body>
but most of my iframe's content starts in one file and ends in another file,
hence to insert a body tag for an iframe i require to change two files for an iframe.
Hence without doing this if i thought of including the below script in all iframe's content.
<script type="text/javascript">
document.body.o nLoad = link disabling_funct ion (document)();
</script>

But the script does not work.

Please help me to make the script work, or suggest me a method , to call this function [link disabling_funct ion]onLoad of the iframe.
Feb 17 '09 #5
Revathi Balakrishnan
40 New Member
i would like to know, if there is any other method ,which would make my iframes to call my function onLoad, with out even inserting anycode in the iframe content.
Feb 17 '09 #6
gits
5,390 Recognized Expert Moderator Expert
are all iframes-contents from your domain and does they not! have an onload already?
Feb 17 '09 #7

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

Similar topics

6
14410
by: Wendi | last post by:
If i have an iframe from within an HMTL document: Iframe.htm: ------------------------------ <html> <head> <title>Iframe.htm</title> </head> <body> <iframe src="sample.htm"></iframe>
2
8242
by: Gunther Radick | last post by:
Let's say I've an IFRAME on a page, with an ID of "myFrame". If I call - myFrame.document.write( "Something" ); the "Something" gets written to the IFRAME, as expected, but the browser (and this happens with all four major browsers) continues to "load" the page. Even if there's nothing else left to load.
6
10954
by: Razzbar | last post by:
I've written several utility pages that use a dynamically created iframe. The iframe typically has a form that is populated by the main page. Then the form is submitted to be processed, and the returning page does something -- call a function on the main page, change a variable on the main page, etc. All this stuff I created works on IE. Sorry, didn't have other browsers available to test. Now I have access to a machine with FF, and none...
26
45523
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function defined in "A.html", but every attempt results in an "is not a function" error. I have tried to invoke the function using parent.document.funcname(), top.document.funcname(), and various other identifying methods, but all result in the above...
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.
4
2106
by: Laphan | last post by:
Hi The god that is Martin Honnen gave me a great tip to DOM/JS some HTML data into an iframe, but I need to make sure that the iframe is ready to take it before I paste it in. At the moment, if I don't specifically click into the iFrame (it is in design mode) then when I paste the HTML it attaches itself to the main document rather than in the iframe 'body'.
1
8136
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible to gradually zoom an iframe, and if so, what am I missing? Here is the script I am trying to manipulate, between the head tags: <script language=JavaScript> /**** adjust these two parameters to control how fast or slow
1
3545
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe height based on the each iframe's content height. It is work well on IE, but the error "has no properties" occured with firefox on code as below. Where both code is to get the id of iframe on file1....
0
9595
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
10232
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
10008
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,...
0
9873
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7420
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
6682
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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

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.