The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Close Initial Site Window

Suppose in your index.html file that you open another window (without toolbars) as the main window for your site, and then naturally you want to close the first window (index.html) since its purpose is only to open your main window.

When I call self.close() from index.html, I get a prompt from IE saying that the window is trying to close itself. Is there a way to avoid this or do I have to keep that first window open?

You can't close the browser window on your users without getting that popup message in any browser I've tested it on.

Another deeper question is, why would you go and close the browser window haphazardly on your users? They may need that "back" button you know, your site may not be their homepage. It's generally bad practice to try and close this window and I'm wondering why the lack of toolbars is so necessary. Any halfway savvy user will be able to use the keyboard shortcuts to do what they want such as open a location with ctrl+L. Also, once that's open, they can type javascript: commands to put toolbars and resizing back on the window. I'd suggest finding another method of accomplising your goal without ticking off your users.