thewooleymammoth Posted September 8, 2009 Share Posted September 8, 2009 i have a link that i would like to open a new window with. However when i open a new window it brings the original window to a page that just says [object Window] so i figured return false; was the right move, but then when you click the link nothing happens, any advice <a href="javascript:return false; window.open('/ads/view.php?id=$id', 'Print Coupon', 'width=600, height=500, toolbar=no, location=no');">Print this Ad</a> Quote Link to comment Share on other sites More sharing options...
corbin Posted September 8, 2009 Share Posted September 8, 2009 Put the return false after it. Also, put it in an onclick, not href. Quote Link to comment Share on other sites More sharing options...
haku Posted September 8, 2009 Share Posted September 8, 2009 What he said. When you return anything, the rest of the script isn't executed. Since you put your return at the very start, everything after the return is ignored. Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted September 9, 2009 Author Share Posted September 9, 2009 sweet thanks, idk if you noticed, but i am pretty new to js. couldnt find any info on this anywhere Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.