Welcome to WebmasterWorld Guest from

Message Too Old, No Replies

Google and javascript "onclick" event

Can google read it?



1:13 am on Aug 3, 2006 (gmt 0)

5+ Year Member

Yo guys,

I've got one question for real se experts...so if you're not sure please don't answer. I need 100% correct answer, and the question is "Can google read javascript even onclick and content inside it?"
Let's make an example...I hipotetically have page with a hrefs and onclick inside them, smth like

<a href="http://www.site.com" onclick="javascript.event">Blah</a>

I am wondering whether Google follows only the real url (site.com) or it reads javascript as well? Let's say I want to display one url to people with j/s turned on and one to the others who don't have j/s turned on in their browsers... What would google do? onclick even should contain window.open() j/s function with different url than site.com . Again will google just follow a href (site.com) and ignore onclick j/s event?

Thanks in advance,


12:18 pm on Aug 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

yes..its just plain text at the end of the day..google will follow the link inside the script....

you seem to simply be saying there will be two urls...one inside javascript and one not...so both will be followed....whats the big deal with onclick?....google isnt using javascript..just reading the code....


1:04 pm on Aug 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

following the introduction of BD infastructure i can confirm that google bot has read and followed everything thats within the Javascript tag on a number of ours and clients sites

Previously for many years Google did not/ could not read Java Script now it can.

Thats my take on it


6:52 pm on Aug 4, 2006 (gmt 0)

5+ Year Member

Thanks for the answers guys.
So the simple answer is that Gbot can read onclick js code. The question is now, will it follow the real url inside a href or it'll follow the onclick (window.open(url)) url as well? I need it just to follow the url inside a href not the other one...

Is it possible? Is Gbot that smart to follow both urls? If it is, do you have some idea how to send spider bots (to allow them to see full real url) to certian place and people with js on, to go through the script and also open the dest. url, but as I said their click would go through js function window.open and then inside it will be placed script through which will browser go...

Get my question?


3:46 pm on Aug 5, 2006 (gmt 0)

WebmasterWorld Senior Member bigdave is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Google can, and often will, follow anything that it even suspects is an URL on a webpage. That includes anything in the text, in comments and in the JS.

That does not mean that all those URLs will get full credit as a link. They won't. Google just uses that information to try and find new pages. The href= is the part that will get all the credit, including the PR and the link text.


4:43 pm on Aug 5, 2006 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

BigDave, you said it well -- this is exactly my experience over many sites. A link is the element that PR measures, and the element that "anchor text influence" is all about. Anything else that looks like a uri may be tested by the spiders (they are a uri-hungry bunch) but it just doesn't have the same effect on ranking that a link does.


12:25 am on Aug 6, 2006 (gmt 0)

5+ Year Member

Hey guys...thanks for the answers!
I got it now... Just another question...

What about the site that contains only pictures that link to other sites....let's say I have 100 pics (10pics in 10 rows) and all of them have some alt text...also all of them link to other sites where is link back to my site.

Will google like this kind of linking? It'll follow all the links on my site, but won't it penalize such a behaviour just because it might be looking like link farm....tons of links (just imgs with alt text might be considered as some content) and nothing more... Is it ok to make such a site? Just pure hard links to those sites but just inside pics. You get me, right?

Thanks in advance,


12:33 am on Aug 6, 2006 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Images like pixel links?


12:47 am on Aug 6, 2006 (gmt 0)

Are you doing work arounds with Flash design by chance?


1:35 am on Aug 6, 2006 (gmt 0)

5+ Year Member


No, just real pics (thumbnails) with their own width and height... say 100x100 each pic that will lead to particular site, associated within that thumb.


I used to do Flash designs in the past, not anymore. I don't have time for designs. I just optimize my sites as much as I can for SEs, and Flash is not a good choice if you ask me ;)



12:28 pm on Aug 7, 2006 (gmt 0)

5+ Year Member

bump bumP!

Featured Threads

Hot Threads This Week

Hot Threads This Month