MODAL POP-UP
showModalDialog MethodCreates a modal dialog box that displays the specified HTML document.
Only Internet Explorer supports this method
Syntax
vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
Return Value
Returns the window of the document specified in sURL
The syntax of showModelessDialog() is identical
CLASSIC POP-UP
JavaScript window.open Method
JavaScript allows you to create (open) new windows. Run whatever HTML code you wish in these windows. You can even have actions in one window effect another window.
The syntax of the window.open method is given below:
open (URL, windowName[, windowFeatures])
URL
The URL of the page to open in the new window. This argument could be blank.
windowName
A name to be given to the new window. The name can be used to refer this window again.
windowFeatures
A string that determines the various window features to be included in the popup window (like status bar, address bar etc)
You could add a TARGET="_blank" to the <a>-tag.
COMBINED MODAL/CLASSIC POP-UP
Browser considerations
Since only Internet Explorer supports this method you need to allow users an alternative.
Below is simple code to check for browser compatibility.
if (window.showModalDialog) {
win = window.showModalDialog("somedialog.html", ...);
}
else {
win = window.open("somedialog.html", ...);
}
CSS POP-UP