Forum Moderators: phranque

Message Too Old, No Replies

Javascript Open New Window/Redirect

         

EricEC

9:19 pm on Dec 16, 2008 (gmt 0)

10+ Year Member



Hello,

I'm having a little problem. I would like to create a page to redirect users to another website in a new window if they click a certain link. I would like to use javascript to do this.

Here is an example. Say you have to links... example1/game.php and example2/game.php. I would like the script to... if the user clicks example1/game.php to open a new window and redirect the user to a new website. If the user clicks example2/game.php, I would like the user to stay in the site and continue onto the page example2/game.php.

Is there a way to do this using javascript in a php file?

Thanks,

Eric

maximillianos

10:34 pm on Dec 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



window.open(url,"windowName",'scrollbars=auto,resizable=yes,width=300,height=300');

Read up on the 'window.open' syntax. It has more options.