473,795 Members | 2,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ONLOAD is there an afterLoad alternative (Iframe problem)

Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?

Richard
Jul 23 '05 #1
2 9546
Rich wrote:
Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?


If your iframe is named iframe:

iframe.onload = functionYouWant ToRunWhenTheIfr ameLoads;

should do the trick.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 23 '05 #2
"Berislav Lopac" <be************ @dimedia.hr> wrote in message news:<c6******* ***@ls219.htnet .hr>...
Rich wrote:
Is there any way I can check to see if a document is loaded into the
iframe before I call onLoad (sort of an afterLoad).

I'm loading up a page into an iframe. But because we use four servers
which use load balancing, the content isn't specified straight away.
Therefore as I'm using onload to resize the iframes scroll bars to the
size of the iframe content, I need to wait for this to be loaded
first. Is there an alternative to onLoad that will do this?


If your iframe is named iframe:

iframe.onload = functionYouWant ToRunWhenTheIfr ameLoads;

should do the trick.

Berislav


Cheers Berislav,

But.... the code doesn't understand that when I do iframe.onload =
functionYouWant ToRunWhenTheIfr ameLoads; what 'iframe' is. I have named
it iframe. Its using "Load balancing" so it can potentially be using 4
different iframes so therefore doesn't know which server the content
for the iframe is coming from. So it sees the iframe as null and sets
the iframe scrollbar to size.

Is there any way of discovering which server the iframe content is
coming from then using it to measure its height and resize the screen?

Rich
Jul 23 '05 #3

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

Similar topics

2
7444
by: saayan | last post by:
Hi, I have a php generated HTML page, which has a javascript call in the body tag: <body onunload="exitPage()" onload="setWidth()" onresize="setWidth()"> In certain cases, there can be an iframe in the page: <iframe src="/secure/download.php?dl_file=test.txt" style="display: none" />
1
3062
by: Koms Bomb | last post by:
I create two iframes dynamically to get data from the server. I want to deal with the data after it's downloaded, so I set the two iframes' onload event handlers to current document(not the iframe self), the handlers' JS code is generated dynamically too. But I found only the second event is triggered and I can't get the first iframe's onload event. Why? The data in the first iframe is really arrived, but it doesn't trigger the onload...
8
63999
by: niebo077 | last post by:
Look at the following code: <html> <head> </head> <body> <iframe id="olaf" name="olaf" onload="alert('no');"></iframe><br> <input type="submit" onclick="document.getElementById('olaf').src = 'phpinfo.php'" value="Test">
0
5893
by: dimepiece18 | last post by:
On our Intranet homepage, I have a layer with an iframe contained in it. The iframe is linked to an html document that is stored in our Content Library system. You have to be authorized to view the documents in Content Library. The problem I'm having is that when you launch the Intranet site, the SSO login screen appears, but it looks like the iframe is trying to launch the html file before the homepage loads. So after you log in, the iframe...
7
9638
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the time I got serious about using Javascript for more than just rollover images... I now would like to learn about the concept for the purposes of creating Ajax-like requests across domains. I felt like I had the basic concept down, but am...
20
11915
by: Mark Anderson | last post by:
Hi, I have this in an external JS library: ///////////////////////// function addMyEvent(){ var obj; if(document.attachEvent) { obj = document.getElementsByTagName('img'); for (i=0;i<obj.length;i++) { obj.attachEvent('ondrag', noDrag); }
3
2969
by: whatever0 | last post by:
Hi, I'm fairly new to javascript and was hoping i could have a little help... I have a page containing a form and an iframe. The iframe is initially empty (src="about:blank"). The target of the form is the iframe, so when the form is submitted the iframe loads a page (which is remote and I cannot edit). What i would like to happen is that when the contents of the iframe has finished loading, the page (as in: the entire page) then...
4
3258
by: removeps-groups | last post by:
Hi. Is iframe supposed to have an onload event? Many documents in google have examples of this method. It works in Mozilla 2. However, http://www.w3schools.com/TAGS/tag_iframe.asp does not have it. If it not supposed to be there, why is that, and what is the workaround?
0
9672
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
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10439
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
10215
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
10165
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
7541
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
6783
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
5437
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...
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.