Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to auto. close browser window on script end 1

Status
Not open for further replies.

bradsteele

Programmer
Oct 19, 2004
24
CA
Hi,

I am fairly new to Javascript and I was wondering if anyone knew of a way to close a browser window after a script ends. The script will be launched by the task scheduler. I don't want any pop-ups or to be asked to press a button or anything, it should be totally automatic when the script finishes. I can use code from VBScript, PHP, HTML and JavaScript.

Thanks

Brad
 
try window.close() although with some configurations this will prompt the user to ok the closure.
 
Yeah, you get prompted for a click button confirmation, which is what I am trying to avoid. Thanks for the suggestion. Anything else you can think of?
 
You'll be lucky if you find anything. Keeping sites from opening and closing windows anonymously and silently is a big security issue.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
I guess so, however I am just running this script on my server, and I know I can write a script with WSH that opens a window, executes, and then closes itself down. I just thought that I could do the same on a web-based system? Maybe there is no solution, but I will keep looking/trying things.
 
There is no solution using Javascript for this problem. You may find an ActiveX solution (but be aware that it is limited to Windows IE only).

Jeff


[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
What about VBscript or PHP or HTML......is this basically impossible because of security issues?
 

There is (always) a solution, at least in IE. The answer is not from me, it was already posted, but I can't find the threads any more, so here it is:

Code:
window.opener = this;
window.close();

vlad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top