These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:21 pm Advanced search

[fixed] <a href="..." target="_blank"

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

[fixed] <a href="..." target="_blank"

Postby Le Sage » Mon Feb 04, 2008 9:27 am

Hey all! :)
I hadn't checked the validity of my HTML5 webpage for a while, and I recently (i.e. 5 minutes ago) discovered that the target="_blank" link is now forbidden?? :shock:
my webpage : http://www.html5.fr
validity of it with Henri Sivonen's validator : http://hsivonen.iki.fi/validator/html5/ ... w.html5.fr
errors:
Error: Bad value _blank for attribute target on element a: Browsing context name started with the underscore and used a reserved keyword blank.
[...]
Syntax of browsing context name:
A browsing context name is any string that does not start with an underscore (_), or, a string that case-insensitively matches one of: _self, _parent, or _top.

That's really new, as last time I checked the spec it wasn't written anywhere.
So is "_blank" really banned? What are the reasons for it? Where is it specified in the specs?
Thanks for you informations about this, & have a nice week. :D

[ADD]: ok, found this in the specs. So from now on, it's unadvised to use target="_blank"? Like in strict DTDs?
Last edited by Le Sage on Tue May 06, 2008 9:13 am, edited 1 time in total.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby anne » Mon Feb 04, 2008 2:57 pm

Well, we're still discussing the details of the specification. I believe there's quite some proponents for allowing this, but the editor has not yet looked at that feedback.
User avatar
anne
<h4>
 
Posts: 32
Joined: Tue Feb 06, 2007 11:17 pm
Location: Utrecht, NL

Postby Le Sage » Mon Feb 04, 2008 7:23 pm

I see...
So anyway target="_blank" will work, but the question is whether it's gonna be advised to use it or not, right?
I guess if it becomes forbidden (i.e. not advised in the specs), there won't be many (I mean even fewer) pages that validate in the web.
It might be the reason for developers (like me for my personal web pages, & for the web pages I develop for my client) not to do valid HTML5 pages, as for me it's been the only reason for now.
Well, wait and see... :)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby urbanjost » Sun Feb 24, 2008 3:35 am

After reading the caveats it seems like it's being made harder than
it needs to be. But since all the major browsers support JavaScript
and the window.open() function it seems removing this option is
going to turn simple HTML into clutter unneccesarily. For example:

NOW:
====
<a target="_blank" href="http://home.comcast.net/~urbanjost/index.html">New Window!</a>

IF TARGET="_BLANK" is dropped (this passes)
==============================
<form>
<input type="button"
value="New Window!"
onclick="window.open('http://home.comcast.net/~urbanjost/index.html',
'mywindow',
'width=800,
height=800,
toolbar=yes,
location=yes,
directories=yes,
status=yes,
menubar=yes,
scrollbars=yes,
copyhistory=yes,
resizable=yes')" />
</form>
urbanjost
<h5>
 
Posts: 16
Joined: Sun Feb 03, 2008 3:48 am

Postby Le Sage » Tue Feb 26, 2008 1:02 pm

If target="_blank" is dropped, it will still be supported by all browsers.
I know at least 4 ways to do the same effect with other HTML &/or JavaScript code, this isn't the question. If target="_blank" is dropped, it must be for a reason (as it is dropped for a reason in XHTML 1.x strict, reason that I & many other developers over the web don't support).
So if HTML5 drops target="_blank" for a reason that I won't support (like using the same reason as for XHTML 1.x), I (& most probably many developers) will still use target="_blank", & my documents won't validate.
Until then, I'm waiting for a valid reason (didn't find it in the specs), & the debate is still open of course. :)
See _blank in HTML 4.01 specification
Thanks for your tip, though.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby Le Sage » Mon May 05, 2008 12:21 pm

victory :D (half victory, though, but still)
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest