[wp-trac] [WordPress Trac] #9194: Change code from Target="_blank" -TO- onclick="window.open(this.href); return false; "

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 20 20:46:36 GMT 2009


#9194: Change code from Target="_blank" -TO- onclick="window.open(this.href);
return false;"
--------------------------+-------------------------------------------------
 Reporter:  Kenv          |       Owner:                  
     Type:  defect (bug)  |      Status:  new             
 Priority:  normal        |   Milestone:  2.8             
Component:  Validation    |     Version:  2.7             
 Severity:  normal        |    Keywords:  Target=, _blank,
--------------------------+-------------------------------------------------
 Any time I direct visitors to content that is not on my site I attempt to
 always utilize the Target="_blank" which is total appropriate since I use
 Transitional DTD.

 WordPress 2.7.1 creates:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 Admin > links > edit/add new > Target >  _blank/_top/none

 selecting Target _blank creates a depreciated attribute of target="_blank"
 under the "Strict" DTD

 Strict DTD requires:
 <a href="another_page.html" '''onclick="window.open(this.href); return
 false;"''' title="Another page new">Open in new window!</a>

 ''W3C validation:
 Line 340, Column 107: there is no attribute "target".''

 ''…ometics replicated web site." target="_blank">Biometics™
 Info</a></li>''

 ''You have used the attribute named above in your document, but the
 document type you are using does not support that attribute for this
 element. This error is often caused by incorrect use of the "Strict"
 document type with a document that uses frames (e.g. you must use the
 "Transitional" document type to get the "target" attribute), or by using
 vendor proprietary extensions such as "marginheight" (this is usually
 fixed by using CSS to achieve the desired effect instead).''

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/9194>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list