HTML and CSS Reference
In-Depth Information
Create an unnamed window
All the popular browsers support a special target named _blank [*]
that lets you create a new window. The _blank window has limited
use, though, because it is namelessyou cannot direct any other
documents into that window. (New documents loaded via hyper-
links selected by the user within the window get displayed in that
same window, of course.)
[*] Some browsers also accept the name _new . If you can't get _blank to work with
your browser, try _new .
17.4.2. Overriding Others' Targets
Ever visited a site whose home page is a frame document that never
gives up? You know, the kind that leaves its great big logo on the top of
the window and its site TOC running down the side of the display, staring
you in the face long after you've hyperlinked away from the site? What if
your site's frameset gets trapped into one of their window frames? What
to do? (Apparently their webmasters haven't heard about the _blank tar-
get.)
The short answer is to use JavaScript to force open a new window for
your documents. But that, too, is potentially confusing for users because
they may already have a full window ready for your document. So, to
embellish, let JavaScript discover whether your page is destined for a
corner frame or for the whole window.
Here is an example script that loads a web page called index2.html into
its own full window. Note that JavaScript-enabled browsers won't let you
clear a previously loaded document display unless your document owns
it. So, in the case where the target is not the whole window (i.e., self is
not window.top ), the example script opens a new window that becomes
the target for your pages. The user may choose to close your document
window and return to the other one, or vice versa:
<html>
<head>
 
 
Search WWH ::




Custom Search