Forum Moderators: open

Message Too Old, No Replies

Google and javascript links - again...

Can someone provide some irrefutable evidence of what gives?

         

Dan_Vendel

8:09 am on Nov 21, 2004 (gmt 0)



Hi,

I have been searching the forum hi and low, found several links to several threads (many of them gave me 404s, though), but many were outdated, and none gave any final proof or strong argumentation of whether javascript links are found by Googlebot and followed or not?

Can someone produce something worthwhile?

Cheers,
Dan

Birdman

5:23 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can confirm it. They do find links in JS and index them.

I had the problem of duplicate content due to a "print this page" link on every normal page, which had different urls. To stop this, I changed all "print" links to javascript only links, moved them to a /print/ folder and banned that folder in robots.txt.

The result? All the NEW URls got indexed! I figured I had double protection from the links being hidden within JS AND the ban of the /print/ folder in robots.txt. Nope!

Google will find JS links.

Google will index(not crawl) those links, even if they are protected by robots.txt.

Patrick Taylor

5:38 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it depends on how you write your JavaScripted links. Some ways, Google is able to follow the link, others not, especially when they're in an external JS file and written with 'document.write'.

The more interesting point, perhaps, is whether or not Google respects robots.txt.

Dan_Vendel

5:58 pm on Nov 21, 2004 (gmt 0)



Birdman, Taylor,

Thanks for responses.

Birdman: To clarify: By "not crawl", do you mean that they will not follow the link, then? Just register (index) that it's there?

Also, have you seen any article or other page confirming this?

Cheers,
Dan

kaled

1:25 am on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



robots.txt aside, Google crawls urls. When an url is encountered in html, it is assumed to be relative to the page (unless absolute or the base tage specifies otherwise).

In javascript, urls are recognised if they are fully qualified, ie they begin 'http://...'

So far as I am aware, javascript links do not pass PR but that may depend on how they are formed.

Kaled.

BigDave

1:31 am on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my experience (which is far from irrefutable evidence) google will find anything, anywhere on the page, that lookls like it might be an URL, and they will try and follow that URL.

What they do not do is pass PR unless it is an actual link.

Hugene

2:10 am on Nov 22, 2004 (gmt 0)

10+ Year Member



I am using a JS pop-up launcher that I got from the Internet somewhere. One of my pages seemed not to get indexed, so I changed the link to my now favorite target=_blank and the page apperead on G in a matter of days.

This was a year ago, maybe things changed. Also, maybe my JS was really badly written.

But I recomd you do not exclusivelly use JS for links. Plug in a pure A tag link somewhere (like the link listings at the bottom of a page for example) just to be safe

Birdman

12:19 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman: To clarify: By "not crawl", do you mean that they will not follow the link, then? Just register (index) that it's there?

In my case above, they only indexed the link, without actually crawling the page because of the ban in robots.txt. There is no title or description in the SERPs, only the URI.

I think it depends on how you write your JavaScripted links

Very true! I wish I had scrambled the link now.

Birdman