shougan wrote:- Code: Select all
<a href=""
target="_blank"> </a>
The only problem with using the target attribute is that it is not valid in the "Strict" document type HTML/XHTML.
So if you are interested in writing pages that conform to HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1 you will not [legally] be able to use the target attribute.
Since I try to use the Strict DTD's whenever I can I have found a few methods to get around the target attribute. One of them is extremely complex and I haven't used. It is only applicable to XHTML and involves extending the DTD to include a target attribute. It is a lot of work, but would technically be the "proper" way to achieve target like functionality (without JavaScript).
The second method is the easier method and involves a little bit of JavaScript. If the browser does not support JavaScript, then the link will open in the same window, so nothing is actually lost on old clients.
Lets say we want to create a link to slashdot.org . We want it to open in a new window. Lastly, we want it to conform to the Strict DTD's. The following code would accomplish our task.
- Code: Select all
<a href="http://www.slashdot.org" onclick="window.open(this.href); return false;">slashdot.org</a>
There you have it.
-Weaver
Public Keys
The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers