By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

close all tabs in a single window using javascript

P: 12
hi

i want to know can i close all the tabs opened in a single window using single javascript function..

Gemguy
Apr 12 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN.

You can only close a window using javascript if you have a reference to the window object. So if the windows were opened via javascript, you could call:
Expand|Select|Wrap|Line Numbers
  1. winObj.close();
See example.

Now this would be if you'd opened them yourself and had a reference to them. If you use window.open, the windows are usually popups unless you set them to open as tabs.
Apr 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.