View Single Post
  #2 (permalink)  
Old 02-07-2008, 12:28 PM
BigAlReturns's Avatar
BigAlReturns BigAlReturns is offline
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 291
Send a message via MSN to BigAlReturns
Default

You can do it two ways, the first is simplest, but not guaranteed to work cross browser, as it isn't semantically correct:
<a href="popup.html" target="_blank">Pop Me Up</a>
For example, I use FF and new windows open in new tabs - this link would open in a new tab for me. The best way to do it is using javascript, and I've found a decent method shown below. Don't worry about how it works exactly, but if you're interested then I can explain:
Code:
in <head>

<script type="text/javascript">
function popup(mylink, windowname)
{
if (! window.focus) {
return true;
}
var href;
if (typeof(mylink) == 'string') {
   href=mylink;
} else {
   href=mylink.href;
}
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
</script>

in <body>

<a href="popup.html" onClick="return popup(this, 'WIndow Title)">Pop Me Up</a>
Reply With Quote