twitter  facebook  feedburner  youtube  linkedin

 

Google Reads Javascript Onclick Links

Google is now able to construct much of the page and can access the onClick event contained in most tags. For now, if the onClick event calls a function that then constructs the URL, Googlebot can only interpret it if the function is part of the page (rather than in an external script).

Some examples of code that Googlebot can now execute include:

  • <code><div onclick=”document.location.href=’http://foo.com/‘”></code>
  • <code><tr onclick=”myfunction(‘index.html’)”><a href=”#” onclick=”myfunction()”>new page</a></code>
  • <code><a href=”javascript:void(0)” onclick=”window.open (‘welcome.html’)”>open new window</a></code>

Here are some more links to discussion about Googlebot, AJAX, and Javascript Onclick:

Related posts:

  1. Search Engine Optimization and Flash
  2. See Your Website With the Eyes of a Spider

2 Responses to “Google Reads Javascript Onclick Links”

  1. Great tip to know. I’ve always disliked that Google doesn’t read the info within javascripts. This is a good tip to know that they are now able to read and access the onClick event contained in most tags. Thanks for the advice and keep it up!!

  2. chichi94_test says:

    Hi All,

    First of all, thanks for this article, it’s very intgeresting indeed.
    I’m still a beginner in SEO, but I am getting there step by step…

    I have a question regarding this info on GBot & Javascript and how the whole thing works…

    If you have the following:

    Ancre

    and now “landing_page1.php” has a

    My question is, will GoogleBot just read http://www.mydomain.com (so +1 backlink) and skip the rest ? or will GBot read http://www.abc.com ?

    Or is it SandBox material ???

    cheers

Leave a Reply