473,903 Members | 3,259 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 2643
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);
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>
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
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) ;">
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)();

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
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

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>
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.
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...
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...
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.
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'.
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
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....
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...
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...
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...
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,...
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...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
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: 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.