Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
134
rated 0 times [  137] [ 3]  / answers: 1 / hits: 47704  / 12 Years ago, tue, june 12, 2012, 12:00:00

Just a question about optimization, between :



<a href=# onClick=javascript:window.open('myUrl.com');>link-1</a>


and :



<a href=javascript:window.open('myUrlBis.com');>link-2</a>


Is one better than the other ? Or more compatible ? Thanks.


More From » html

 Answers
8

Best practice is to use the target attribute:



<a href=http://myUrl.com target=_blank>link-1</a>


If that doesn't suit, a click handler (ideally not assigned via attribute) would be my take.


[#84963] Monday, June 11, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
luna

Total Points: 698
Total Questions: 114
Total Answers: 93

Location: Israel
Member since Wed, Apr 14, 2021
3 Years ago
luna questions
;