[Javascript] weird target behavior

TomMallard mallard at serv.net
Tue Jul 10 08:08:06 CDT 2001


It's a loading order issue and happens because the frameset page hasn't
fully loaded so the frame being looked for doesn't exist at the time. This
causes a new window to be created by the browser, a default when the it
can't find a frame.

The solution is to put a settimeout() function into the onload event for the
fast loading page to delay it's loading until the parent/top frame exists...

if(typeOf(top.frameName != 'undefined'){
        top.frameName.document.target.value = targetFrameName;
}else{
        ...delayFunction()...
}

Not sure you need .value,

tom mallard
seattle
----- Original Message -----
From: "Russell Scheinberg" <rscheinberg at lrk.com>
To: <javascript at LaTech.edu>
Sent: Monday, July 09, 2001 7:46 AM
Subject: [Javascript] weird target behavior


> I have a form with a link that opens a new window that displays several
href's to choose from. These links send data parameters back to the original
opener page and reloads the form with values from a database. Pretty basic
stuff. What I want to happen is for the parameter to go to the original
window and then the pop up window closes automatically. What happens now is
kind of funny. The first time the original form is open, the link on the
popup page opens a NEW window with the populated form in it instead of
sending the info to the opener window. Then the popup window with the
choices closes as it should. After that, all subsequent visits to the page
with the choices, works as I want---the parameter are sent to the existing
form and the popup closes. I have fought with this for a week and know that
I've lost my perspective on it. Help would really be appreciated. Here is
the code:
>
> The code on the form that opens the "Clone" popup with links that works
fine as far as I can tell:
>
javascript:newWindow=window.open('LRKLibClone.asp?txtTitle=A','','toolbar=0;
menubar=0,1,locationbar=0,statusbar=0,personalbar=0,scrollbars=0,resizable=0
,width=750,height=550');newWindow.focus()
>
> The code on the page with the links that sends the info back to the
original form:
> <A HREF="/LibLRKAdmn/LRKLibAdd.asp?txtID=<%=oRSbt("ID")%>"
TARGET=javascript:opener.window onClick="window.close()"
STYLE="text-decoration:none"><%=oRSbt("Title")%></A>
>
> As I said it works as intended the SECOND time you get the Clone window
open. But the first time it pops up a new window instead.
>
> Thanks.
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list