Ask HN: the current state of the empty # in 'a href'

https://news.ycombinator.com/item?id=2374135
by keyle • 15 years ago
10 14 15 years ago

What is your take on the a href='#' in web applications?

It used to be and may still be very well be today the 'good practice' to always have a # at least in the HREF. Empty or no HREF could cause issues with some browsers I was told.

Today it raises other problems. Those # litter web applications making link sharing duplicates in news site (ie. .com/# is different than .com/ but shouldn't), it also makes statistics skewed in some stats services.

I personally hate to see those empty domain.com/#

Note I have nothing against anchors actually being used as anchors, ie domain.com/#somesection. That's not what I'm referring to.

It also annoys me off to have those littering # in my browser history (ie. when you type in the url bar).

Is there an alternative? Using <button> everywhere can also cause issues in some browsers I read, with some browser using the content of the button tag as labels while some others use the value attribute.

Is using A with no href still SIN today?

And don't tell me about HTML5. If it's not everywhere it's not on my cards.

Thanks.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com