PDA

View Full Version : Open external link in new window with JavaScript



tlynn721
16 Mar 2009, 03:35 PM
I'm very new to Javascript and I'm having a hard time finding a comprehensive answer to my issue. I posted on another forum but no one can figure out the problem.

I have 2 websites. When a visitor clicks on the link for my main website, I want it to open in a new window. I've tried several variations but nothing has worked so far. Here is my current script:

window.mm_menu_0204220223_0 = new Menu("root",171,18,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#333333","#F4F400","#FFFF80", "left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0204220223_0.addMenuItem("Snake Tray& nbsp;Main Site","location='http://www.snaketray.com', target='_blank'");
mm_menu_0204220223_0.hideOnMouseOut=true;
mm_menu_0204220223_0.bgColor='#003300';
mm_menu_0204220223_0.menuBorder=1;
mm_menu_0204220223_0.menuLiteBgColor='#003300';
mm_menu_0204220223_0.menuBorderBgColor='#003300';

What do I need to add to this script to make www.snaketray.com open in a new window?

Thank you!

tr.andrus
16 Mar 2009, 06:34 PM
you are trying to open a popup. i would avoid popups if you are transferring your use to another site you want them to explore because they often get blocked by browsers. i'd use:

<a href="http://www.snaketray.com" target="_blank">Visit my other site</a>