pikemsu28 Posted February 6, 2007 Share Posted February 6, 2007 is there a simple script to automatically close a browser after so long. i've found scripts that close a popup but this isn't a popup i want to close. i have a task manager scheduled to load a php script that sends out an email and i want the browser to close without having to close the browser manually. thanks, Jason Quote Link to comment Share on other sites More sharing options...
richardw Posted February 6, 2007 Share Posted February 6, 2007 Add this in the head tag... <META HTTP-EQUIV="Refresh" CONTENT="30;URL=javascript:self.close()"> Although this works, browsers may interpert this the wrong way and inform the user of an outside influence before colsing. Not recommended unless its a limited audience that you know. If you do use it, change the 30 which is this time in seconds. (not PHP, but javascript) Best Quote Link to comment Share on other sites More sharing options...
artacus Posted February 6, 2007 Share Posted February 6, 2007 I don't think its possible to close the browser. Only a popup window. Quote Link to comment Share on other sites More sharing options...
pikemsu28 Posted February 7, 2007 Author Share Posted February 7, 2007 i figured it out. i used this code: <script language="JavaScript"> <!-- function CloseWin(){ setTimeout("window.close()", 10000); } // --> </script> <body onload="window.opener='';CloseWin()"> can someone please close this thread! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.