Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Using <a href='javascript:;'> instead of <a href='#'> #6

Closed
bkniffler opened this issue Nov 30, 2015 · 5 comments
Closed

Using <a href='javascript:;'> instead of <a href='#'> #6

bkniffler opened this issue Nov 30, 2015 · 5 comments

Comments

@bkniffler
Copy link
Contributor

Hey, would you consider switching href '#' to href 'javascript:;' in the header component? It is much safer to use.

@alexcurtis
Copy link
Collaborator

@bkniffler Hi. Yeah sure. I'd be interested to know why it is safer?

@bkniffler
Copy link
Contributor Author

Under certain circumstances # will send you on top of the page, whereas javascript:; or javascript:void(0); won't do anything. Neither is great, but the second one is better. You could also think about not using <a/>.

More comments on this issue:
http://stackoverflow.com/questions/134845/href-attribute-for-javascript-links-or-javascriptvoid0
http://stackoverflow.com/questions/17789735/use-of-javascriptvoid0-v-s

@alexcurtis
Copy link
Collaborator

@bkniffler Thanks for clearing that up. Yes, I think we need to change this. Would you be able to submit this as a pull request please?

@alexcurtis
Copy link
Collaborator

@bkniffler I've released this under 1.0.12 in npm. Thanks for your help.

@bkniffler
Copy link
Contributor Author

Hey, thanks. I just created another pull request without <a/>, you might think about this one as an alternative. If you don't want that, just reject it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants