Avatar of DancingFighterG
DancingFighterG
 asked on

Javascript - Window.open in a tab

Hello,

I'm trying to a change to an old website that uses javascript to open up pages in pop-up boxes and change the functionality to op up the page on a new tab. Overall, I'm planning to move this entire website to a CMS system such as WP or Joomla but for now I'm going to fix this issue. Here is an example of the code that is being used to allow this to function with pop-ups:

Menu2=new Array("For the Employee","","",4,23,162);
	Menu2_1=new Array("Corporate HR","javascript:window.open('/hdintranet/divisionsites/corporate/redirectCorpHR.html','','toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,height=400,width=630,top=30,left=160,position=40')","",0,20,185);
	Menu2_2=new Array("Plastics & Die Casting Center HR","javascript:window.open('/hdintranet/divisionsites/manufacturing/owensboro/index.html','','toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,height=400,width=630,top=30,left=160,position=40')","",0,20,185);
	Menu2_3=new Array("Window Fashions Division","javascript:window.open('/hdintranet/divisionsites/manufacturing/wfd/index.html','','toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,height=400,width=630,top=30,left=160,position=40')","",0,20,185);
	Menu2_4=new Array("Information Center","","",3,20,150);
			Menu2_4_1 = new Array("Cell Phone Discounts","/hdintranet/foremployees/informationcenter/phonediscount.html","",0,20,150);
			Menu2_4_2 = new Array("Do Not Call Registry","/hdintranet/foremployees/informationcenter/phonedonotcall.html","",0,20,150);
			Menu2_4_3 = new Array("Hertz Rent2buy Discount","/hdintranet/foremployees/informationcenter/hertzdiscount.html","",0,20,150);

Open in new window

JavaScript

Avatar of undefined
Last Comment
DancingFighterG

8/22/2022 - Mon
Anthony Pangilinan

I believe it's up to the browser settings to tell the window to open in a new tab, but it might work just removing all the other arguments like this:

window.open('/hdintranet/divisionsites/corporate/redirectCorpHR.html');

Open in new window

DancingFighterG

ASKER
Ok, I can take away the pop-up with no issues but I now need it to open up in a different table
Anthony Pangilinan

It's up to the browser after that.  You can force a popup, but not a tab.  Most browsers should default opening a '_blank' window to a new tab.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
DancingFighterG

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question