Solved

How to change the opened window setting without using "window.open(...)"

Posted on 2004-10-09
3
488 Views
Last Modified: 2008-03-10
Hi! I don't know whether to post this question on javascript or ASP topic area but I am getting that I will get an answer quicker by posting this on ASP topic.

I currently developing a logout.asp to logout user. What my client want is that after logout the screen will redirect to their home page. In addition they want unhide the window's address bar.

Because of that I am new to ASP, I only know javascript's "window.open("www.homepage.com", "_parents","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, top=0, left=0, width=" + screen.availWidth  + ", height=" + screen.availHeight);" to furfill this task.

On my login.asp I wrote:

window.open("login.asp?username=xyz","new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, top=0, left=0, width=" + screen.availWidth  + ", height=" + screen.availHeight)}

On my logout.asp I wrote:

self.close();
window.open("http:www.yahoo.com","_parents","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, top=0, left=0, width=" + screen.availWidth  + ", height=" + screen.availHeight);

A problem is that I am getting a prompt of "Close window?" for the user which I don't want. So I am thinking another way other than "window.open(...)" which can set the window's settings like menu bar, scrollbars, location and toolbar etc.

Can anyone give me the code (either javascript or vbscript) to solve this issue please?

0
Comment
Question by:limct
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 12266148
Two things:

1) there is very little that you can do other than to resize the window once it is opened
2) you can get rid of the prompt by doing this:

<A HREF='Close' onclick='self.opener=null;self.close();return false;'>Close Window</A>

That will allow you to use the window.open withoiut the distracting prompt.

FtB
0
 

Author Comment

by:limct
ID: 12268325
Hi fritz_the_blank,

Is there an alternative to "window.open(...)"? What I mean is rather close the window "self.close();", is that another way to redirect the page to another page while also change the setting of the window ie. location=yes, menubar=no, toolbar=yes and etc?

Thank you
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12268787
The idea is that you do two things:

1) Spawn the popup via window.open so that you can specify all of the parameters
2) use code similar to the above to close the spawning window without the alert

As far as I know, and this question has been asked many a time, there is no other way to accomplish what you ask.

ftB
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP Syntax for IF statement 21 59
SQL Filter Question 8 82
Problems using Provider=OraOLEDB.Oracle via VBScript/Classic ASP 5 66
Select record with the most recent date 14 54
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question