html+js links come - advanced seo question

by 6 replies
7
hi guys,

the following questions regards a <a href> + javascript on click combined in a link.

look at the following code:
<a href="domain.com" onclick="javascript:window.open('domain.com/affiliate-link.html');return false;"><img src="image.jpg" alt="image alt" border=0></a>

elements we have:
1. A href link - to domain.com
2. onclick JS event who links to domain.com/affiliate-link.html
3. img src , inside the A HREF, with an alt tag.

my question for you guys are:
1. which link will be counted to site domain.con - will it be the A HREF or the Javascript one? (the a href is a clean hardlink, the JS is a long affiliation link).
2. can the alt tag be counted as an anchor text for this link?
3. can this be called a "sneaky javascript redirect" ? can this be picked up by SE as cloaking?

sorry to say, but i have not live example to show you guys, but based on your understanding, what do you think happens here?

thanks
#search engine optimization #advanced #html #links #question #seo
  • To my best knowledge:
    1) The JavaScript link will not be counted by most search engines. Naturally, in your example, the crawler will scan through the html-href link.
    2) Yes- the alt attribute for the image will be considered as anchor text.
    3) No, the Googlebot just ignores the JS entirely. You're not going to get penalized for cloaking, this is done in ad campaigns all the time- visit any porn site.

    There's been some debate about this issue on the internet: which bots crawl javascript and which don't. I made it a point to research it a while ago.

    Turns out, the vast majority of crawlers ignore links embedded directly into Javascript, like the one you demonstrated. They simply do not follow them.

    It seems Google does this too. You see evidence for it when you visit a cached version of a page with Javascript embedded links: they're often not there or replaced with link (or alt, in the case of images) text.
  • Well actually- in his case- they're good.
    His cloaking with the javascript.onclick popup will override the html link, but the crawler will count the href link.

    So he's cloaking the link to mask his affiliate motive.

    http://www.google.com/support/webmas...n&answer=66355
    • [1] reply
    • thanks ORVN. well those were my thoughts too. but if we make this case a little more complex and on the A HREF link you link to an authority site like yahoo, and the javascript will link to an affiliate site, can't this misleading of user be flagged as cloaking by the big bad bots?
      • [1] reply
  • My observation is that Google will, in some cases, follow Javascript links when the link in question is (a) not a complex script; and (b) is within a hyperlink <a></a> block. It does not seem to follow links outside of <a> tags, such as using a onclick script in a <div>. AJAX and Flash based links also don't appear to be followed from what I've seen.

Next Topics on Trending Feed