Link to home
Start Free TrialLog in
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

Avatar of Anthony Pangilinan
Anthony Pangilinan
Flag of United States of America image

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

Avatar of DancingFighterG
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
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.
ASKER CERTIFIED SOLUTION
Avatar of DancingFighterG
DancingFighterG

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial