Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is suggestedsuggested instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is suggested instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is suggested instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>
Change focus away from "What is best practice?"
Link
200_success
  • 144.2k
  • 22
  • 188
  • 473

Linking Submitting the current webpage to javascript:void(0) for a no-op linkbookmarking site

deleted 17 characters in body; edited title
Source Link
Vogel612
  • 25.3k
  • 7
  • 58
  • 141

JavaScript Linking to javascript:void(0) for a no- Does thisop link need improvement?

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is [suggested][1]suggested instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>

Thanks. Patrick [1]: http://stackoverflow.com/questions/134845/href-attribute-for-javascript-links-or-javascriptvoid0

JavaScript - Does this link need improvement?

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is [suggested][1] instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>

Thanks. Patrick [1]: http://stackoverflow.com/questions/134845/href-attribute-for-javascript-links-or-javascriptvoid0

Linking to javascript:void(0) for a no-op link

I would like to hear your feedback on the link below that lets users add a link to a website. I read that javascript:void(0) is suggested instead of a # for the <a href="" attribute. Is this still the best practice?

<a href="javascript:void(0)" onclick="window.open('https://www.example.com/add?url='+encodeURIComponent(window.location)+'&text='+encodeURIComponent(document.title))" title="Add link">Add Link</a>
Tweeted twitter.com/#!/StackCodeReview/status/328329272320221185
Source Link
Loading