futrose Posted January 20, 2012 Share Posted January 20, 2012 I have these links where the value of $id is pulled from my database, <a href='javascript: window.document.Vids<?php echo $id; ?>.submit();'>Watch</a> and I would like it to open the video in a separate window. Any idea how to make that happen? Thanks Link to comment https://forums.phpfreaks.com/topic/255420-how-do-i-open-a-link-in-a-new-window-using-javascript/ Share on other sites More sharing options...
joe92 Posted January 20, 2012 Share Posted January 20, 2012 Try this Link to comment https://forums.phpfreaks.com/topic/255420-how-do-i-open-a-link-in-a-new-window-using-javascript/#findComment-1309553 Share on other sites More sharing options...
UrbanDweller Posted January 21, 2012 Share Posted January 21, 2012 Check out this w3schools reference. http://www.w3schools.com/jsref/met_win_open.asp Link to comment https://forums.phpfreaks.com/topic/255420-how-do-i-open-a-link-in-a-new-window-using-javascript/#findComment-1309733 Share on other sites More sharing options...
Amit20 Posted January 21, 2012 Share Posted January 21, 2012 Use 'target' attribute of anchor tag. <a href="#" target="_blank" Link to comment https://forums.phpfreaks.com/topic/255420-how-do-i-open-a-link-in-a-new-window-using-javascript/#findComment-1309783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.