Forum Home
Press F1
 
Thread ID: 87785 2008-03-04 03:37:00 Links in XHTML vs HTML question Tony (4941) Press F1
Post ID Timestamp Content User
646170 2008-03-06 22:01:00 OK, slightly OT, but still to do with xhtml and standards:

If I were to stick with using "target=whatever", under what circumstances is that going to:


Get me into trouble
Give the user a less than optimal browsing experience (how's that for marketing speak?)
generally stuff things up?

I guess that question also applies to any other non-strict xhtml I were to use. For instance I use Adobe GoLive, and that inserts its own tags into the html in various places, which cause the page to fail validation.
Tony (4941)
646171 2008-03-06 23:41:00 I realise that -- however, putting the Javascript in an onclick event

reduces the amount of Javascript, thus making it less error-prone for non-programmers
is "correct" XHTML Strict rather than "fooling" the validation by adding attributes via the DOM once the page has loaded


I disagree with your first point as multiple external links render this solution less convenient. Your second is fair and I suppose I should have recommended the most optimal solution which would be JS unobtrusively adding an onclick window.open for every anchor that has an href containing "http://" (ie, an externally linking anchor) thus providing the most convenient and "valid" solution. You can find a write up on this here (
perishablepress.com).
sal (67)
646172 2008-03-07 01:07:00 As a programmer myself, I accept your rebuttal (and, indeed, a variation on your method is exactly what I would have done!) ... however, for those that don't want to "delve" into programming, the code I gave is just a simple "copy-and-paste" for each link you want to open in a new window. I just know how people's eyes glaze over when I start giving them chunks of Javascript ... never mind trying to explain the DOM! :) davehartley (3487)
1 2