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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Best practice is to use the
targetattribute:If that doesn’t suit, a
clickhandler (ideally not assigned via attribute) would be my take.