Solved

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

Posted on 2004-10-09
3
500 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

707 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