Forum Moderators: open
Does anybody know how to modify the snippet below to make it open in a new window?
<a href="javascript:location.href='http://www.example.com/bookmark.php?wt=nw&pub=schmidtandclark&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)">Social Bookmarking</a>
[edited by: encyclo at 2:35 am (utc) on April 4, 2007]
[edit reason] examplified, see terms of service [/edit]
javascript:location.href='http://www.example.com/bookmark.php?wt=nw&pub=schmidtandclark&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)
location.href referrs to the current page, use window.open instead:
javascript:window.open( 'http://www.example.com/bookmark.php?wt=nw&pub=schmidtandclark&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title))
and add target='_blank' to the A tag. You will get a popup warning of course.
[edited by: encyclo at 2:36 am (utc) on April 4, 2007]
[edit reason] see above [/edit]