Marja Ribbers has created a nice little Dreamweaver extension to spawn a custom window [a pop up]. What I like the most in Marja's script is that one can use the 'href' attribute of the current link as its target URI.
As you can read on her site, this technique has the following advantages:
- XHTML Strict mode compatible,
- Search engines won't have trouble 'spidering' the original link.
I would add to this that you're not disabling a great feature of the browser: opening the link in a new window (or Tab).
Consider this very basic markup and script:
<a href="/portfolio.asp" onclick="window.open('portfolio.asp');return false;">Portfolio</a>
The "magic" relies on a single JS statement:
Could that be an excuse then to use a null link for once? Nope! A null link is always a bad idea. There is nothing more frustrating for the user than clicking on a link that doesn't trigger anything. To avoid such frustration I use a "requirements.asp" page [you can call it whatever you want] to let the user know why he/she can't reach the intended link. I use this requirements.asp page as the value for the "href" attribute, like this:
<a href="/requirements.asp" onclick="window.open('portfolio.asp');return false;">Portfolio</a>
In any case, you should never use "
href value; because in Internet Explorer, documents stop loading as soon as a user clicks on such links.
Opening Popup Windows with no extra markup.