View Full Version : Showing an Alert box while a frame is loading

06-06-2007, 11:07 AM
Hello, All,

I am trying to do the following and was wondering if someone could help me (either point me in an easier direction, or tell me what I'm doing wrong...)

I have a page with two frames "AlexTop" and "AlexMain"

Alex Top contains a SELECT statement which essentially navigates the AlexMain frame to a new url.

What I'd like to do is - WHILE the AlexMain frame is loading the new page, a message should pop-up. (I want to use this for errors encountered in the AlexTop frame.)

The code I have right now which is cauing a BUNCH of problems is:

<script type="text/javascript">

function ShowMessage(LeMessage) {
var rSt = parent.AlexMain.document.readyState;
if (rSt == 'loading') {
if (LeMessage) {

function LoadMainAndMessage(MainURL, MyMessage) {
if (MainURL) {
} else {
if (MyMessage) {

To call this, I'm doing a:

<body onLoad="LoadMainAndMessage('http://www.yahoo.com','Error Message Goes Here.');" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

I can't get it to work!!!

Every time it runs, the alert message pops up FIRST. Then the user must acknowledge the Alert before the AlexMain frame will load. (Ideally, they would happen together.)

Furthermore, it appears that when the SELECT box gets changed, the system responds with an Access Is Denied error at the start of the var line in the ShowMessage command.

One final note on the functions:

Because the existence of the URL or Message may be in doubt (sometimes, a selection won't have a URL, or it may not have a message,) that's where the whole condition statement comes from in there... Just in case you were wondering.

Does anyone have any ideas as to how I can fix this?

Thanks much!

- Mike Z.

06-06-2007, 10:04 PM
nothing you can do about the alert and frame loading problem. when you use an alert, it haults all browser processing of any page it is trying to load. only thing you may be able to do is create a layer that you can hide/show in one frame while the other frame is loading.