Is there an SEO risk of using Javascript instead of real links?

Essentially I have a client who wants to change some links from something like:

<a href="http://www.google.com/" rel="nofollow">Click me</a>

      

to something like:

<span style="color:blue;cursor:pointer;" id="faux-link">Click me</span>
<script type="text/javascript">
    $("#faux-link").click(function() {
        document.location = "http://www.google.com/";
    });
</script>

      

Basically, this will make the text "Click me" the same way minus a few extended links (Mouse3 will open the link in a new tab, right-clicking to see "Open in New Window" and other options, etc.), also this doesn't work for anything with Javascript disabled (or if Javascript had fatal errors on the page)

Are there any SEO downsides to this that anyone has experienced or any comments from Google or other users on this type of behavior?

+3


source to share


3 answers


The first example ( <a href="http://www.google.com/" rel="nofollow">Click me</a>

) uses the stander tag <a>

. But even if it uses the attribute rel="nofollow"

, some web spiders may still follow this link. More on this in Nofollow at Google, Yahoo, and MSN .

In the second example, you are using a different way of building the link (using JavaScript and non- <a>

HTML tags like <span>

). Googlebot can execute some JavaScript, but I don't believe it will execute large libraries like jQuery.

Please check the interview with Matt Cutt for more details. Quoting from this interview:



Matt Cutts . We've been crawling in JavaScript for a while and we've been looking for links. Google has gotten smarter about JavaScript and may execute some JavaScript. I wouldn't say we execute all JavaScript, so there are some conditions in which we don't execute JavaScript. Of course, there are common, well-known JavaScript such as Google Analytics that you don't even want to run because you don't want to try to generate phantom visits from Googlebot to Google Analytics.

As I understand it, both examples assumed that web spiders would not crawl or index these links. I think (no evidence or articles to back this up) that using a later approach won't impact SEO significantly.

+3


source


use regular links (unless the sites will be indexed by google!) and use default deny (javascript) for the links you provide. read preventdefault ()



0


source


The links you want to provide in the click event are visible in the page source, so anyone who wants to view them can do it very easily. So, as you said, some legacy link functionality will be disabled, so you can use regular links instead of jQuery.

-1


source







All Articles