New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSHint marks "javascript:void(0);" as a JS URL #1738
Comments
Perhaps this should be a specialized warning? I can't be the only one to have been confused by this. |
You're not. |
Just put this line at the top of your file to disable the warning:
But the best way is to use "#" into the href and to return "false" for all javascript events:
|
No, the best way is to keep your JavaScript out of your markup and attributes :P |
@rwaldron: rectification, indeed
|
Passes jslint: |
@MikeGodin looks like a separate bug. |
@kcampion putting # and return false is not always desirebale |
If I assign an element's
href
tojavascript:void(0);
(as opposed to#
), like so:JSHint picks up the
javascript:void(0);
construct as a Script URL:when in fact it isn't doing anything and is semantically valid. There should be an exception for these types of Script URLs.
The text was updated successfully, but these errors were encountered: