homepage Welcome to WebmasterWorld Guest from 54.163.91.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Usage of href="#" influence on SEO
How does the usage of hash links influence SEO?
stilmark




msg:4664389
 1:22 pm on Apr 19, 2014 (gmt 0)

I have a bad habit of using <a> tags for navigation items on a page. That includes js triggered events.

However, this often leads to a large number of links on the page with href="#".

When running these pages through an SEO diagnose, the result is that there are too many links on the page.

So the question it is better (SEO) practise to use lists without the anchors or other html elements like <div> or <button>?

PS. Hope it's ok to post a SEO related issue in this forum.

 

penders




msg:4670660
 8:47 am on May 13, 2014 (gmt 0)

I have a bad habit of using <a> tags for navigation items on a page.


That's a bad habit?!

IMO using an anchor is the correct, accessible, element to use.

With regards to SEO, I can't see how this is necessarily "bad"? Assuming these are literally just JS actions? The
href="#" (internal) anchors are likely to be simply ignored by search engines.

Using
href="#" there could be usability issues if JavaScript is not available, so it would be preferable to supply some meaningful HREF fallback if possible. Or, if there is nothing you can add and this is only a JS action then generate the entire link with JS.
lucy24




msg:4670670
 9:14 am on May 13, 2014 (gmt 0)

That's a bad habit?!

When is an empty element a good habit?

My impression was that the OP is talking about a CMS/wysiwyg system that shoves in anchors willy-nilly even when they don't go anywhere. If it isn't a link, don't call it one. And if you must use js for everything, at least code it as a real link for the benefit of scriptless users.

As a user, I am annoyed when I click on something that doesn't go anywhere. I am still more annoyed if I then sneak a look at the page source to see if there was a typo, and instead see nothing but <a href = "#">. It smacks of half-finished coding. Take the extra five minutes to get it right.

phranque




msg:4670678
 9:41 am on May 13, 2014 (gmt 0)

from a search engine perspective, <a href="#"> is the equivalent of a self-referring url.
from a user agent perspective (while ignoring javascript events which trigger server requests), clicking this link would not result in a new web server request since the hash mark is a document fragment identifier within the currently rendered document.

jay5r




msg:4670821
 9:13 pm on May 13, 2014 (gmt 0)

Last I knew search engines ignore everything after the #. Which means <a href="#SomeAnchor"> isn't really a link at all (from a search engine perspective) and what's broken is your SEO program that can't figure that out.

lucy24




msg:4670834
 10:08 pm on May 13, 2014 (gmt 0)

Last I knew search engines ignore everything after the #. Which means <a href="#SomeAnchor"> isn't really a link at all (from a search engine perspective)

The "How your data is linked" area in wmt tends to support this interpretation. They include obvious local navigation like "back to thumbnails", but not page-internal forms like "back to top".

:: detour to check that this hasn't changed since last time I looked ::

<topic drift>
The good news is that "click here" doesn't make the top 200. (I hope this means it actually doesn't occur, not just that google ignores it when listing anchor text.) The bad news is that "aquí" does-- and I'm tolerably certain google speaks Spanish. :(
</topic drift>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved