Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The window.history takes focus now
Message
De
08/06/2001 12:04:08
 
 
À
07/06/2001 23:27:27
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00516591
Message ID:
00516978
Vues:
18
>The code snippet is the login form from the main page. The code returned is the following:
>
>
>< SCRIPT>
>window.open("http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?
> 2,19,50,50","_blank","scrollbars=yes,width=1000,height=750,resizable=yes,
> toolbar=yes,menubar=yes,status=yes,location=yes")
>window.history.back()
>< /SCRIPT>
>
>
>I also tried as suggested to have the following:
>
>
>< SCRIPT>
>var newWin=window.open("http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?
> 2,19,50,50","_blank","scrollbars=yes,width=1000,height=750,resizable=yes,
> toolbar=yes,menubar=yes,status=yes,location=yes")
>window.history.back()
>newWin.focus()
>< /SCRIPT>
>
>
>You'll see that this transaction fires a framing environment. I suspect that to be the problem.

I tried the code as you sent it and it works. It might be that the main window, which opens the new window in your case, takes longer to download than what I can re-create locally, and thus takes the focus after it finishes loading. As per my original reply, you might want to consider this, if it works for your scenario:

Submit the form using the form's TARGET attribute; this will automatically open a new window, where the URL in the ACTION attribute will open. Since you already know by the form items submitted what URL to generate (you are returning it to the client in window.open(...)), simply have the code processing the form return that URL to the target window. In ASP this would be accomplished via a Response.Redirect; in WC I am sure there is an equivalent method.
This would result in your main window (the one with the login form) staying in the same state as before the user clicked to submit it(which would be the equivalent of history.back in your code), and another window opening up with the destination URL, and with the focus by default.

Otherwise another alternative would be to add to the destination page, an onload event handler like this:
< body onload="window.focus()">
This should ensure that the destination window will have the focus once it finishes loading up... I am running out of ideas {g}
Andres M. Chiriboga, MCSE, MCP+I
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform