Solved

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

Posted on 2004-10-09
3
483 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now