Href null




















Carlos Delgado Author. Add Your Comment. Become a more social person. Related Articles. May 06, For a variety of valid reasons, you may want to have html anchors with a href that is null for a time. This triggers: Links must not point to " ". Are there ways to achieve the desired effect without lint errors, otherwise can one of these be removed? See: The text was updated successfully, but these errors were encountered:. Sorry, something went wrong. This doesn't work as it means that the href isn't passed to the dom, meaning that the style of the anchor doesn't get the link attributes.

Could you please tell me these reasons? I recall using this technique in early s when I was not familiar even with jQuery. Not sure if it is viable now.

Just for visually design purposes when the route to that specific is either not defined or not implemented. I'd rather use the href attribute than add a class to use cursor: pointer.

Since there is no other way to make an anchor tag clickable I'd be curious why anyone would want this rule to exist, let alone be the default, and not have a way to override it. Would be really nice to remove that rule.

Currently, in react-scripts 1. Yeah, for Skip to content component's link had to use eslint-disable-next-line rule details. I think instead of disabling this line we need to properly explain how to style buttons like links. Just like Bootstrap does. Because anchors are inline elements the style should probably also cater for this use case as well. I also inverted how the underline works from that of Bootstrap to display as links by default with the underline removed on hover.

However the other option can just as easily be done. Maybe some clarification is in order as to why this rule exists and why it is a good idea to follow it instead of finding ways to go around it.

I currently have a PR open that will make the error message clearer and also show where to find more information. It contains an explanation of why this rule exists. But to expand on it, abusing an anchor tag for anything but navigation goes way beyond being contrary to the specification of this element.

Actually out of interest I did try it on an old jsfiddle, but I think there is an issue with your concatenation, it seems to return an error for me. Is your code definitely working? Have a look here: jsfiddle.

Looks like your fiddle is using angularjs 1. I bumped up your fiddle's angularjs version to 1. I hope I didn't overlook a version requirement for your original project, 1.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Podcast Making Agile work for data science. In my version of Safari 4. Looking around I see this happens in IE as well though I cannot confirm. Having the event handler in the attribute has the following benefits over attaching the event after the document has loaded:. Don't use for the reason you mentioned and on some browsers, if the user is scrolled away from the top clicking the link will jump them back to the top.

I use this:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 12 years, 2 months ago. Active 12 years, 2 months ago. Viewed 11k times.



0コメント

  • 1000 / 1000