Solved

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

Posted on 2004-10-09
3
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 informatio…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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