seo - javascript onclick based links? - Stack Overflow

I have seen many websites includes apple and most of asp sites uses<a onclick='s_objectID="

I have seen many websites includes apple and most of asp sites uses

<a onclick='s_objectID="";return this.s_oc?this.s_oc(e):true'></a>

kind of links. i.e. no href on a tag. and link embedded to onclick event.

what are the reasons for that ? analytics ?

How does it affect on seo ?

I have seen many websites includes apple and most of asp sites uses

<a onclick='s_objectID="http://www.apple./mac/_2";return this.s_oc?this.s_oc(e):true'></a>

kind of links. i.e. no href on a tag. and link embedded to onclick event.

what are the reasons for that ? analytics ?

How does it affect on seo ?

Share Improve this question asked Jul 7, 2010 at 5:23 iamgopaliamgopal 9,1526 gold badges40 silver badges54 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 7

This is most likely analytics tracking code used by Adobe SiteCatalyst (formerly Omniture). Check to see if the page contains a script called s_code.js or something similar. If you search the minified code, you will see that it utilizes s_oc.

Well in ASP.NET the links that have onclick only defined are LinkButtons - a specially formulated link that causes a postback. I'm not a big fan of it purely for the reason that it creates nasty inline JS. I'm not sure for what purpose Apple uses the links you mentioned.

As for SEO - it all depends on the engine, I know Google do follow some javascript links but not all engines do. In general its best practice (and not only for SEO) to not put inline JavaScript into your links (or any other elements). It is not accessible, it makes your site harder to maintain and its just ugly.

Some websites will use this technique for analytics. Also, sometimes people will use it to hide the URL when people hover over the link or to customize where the URL goes. Also, it can be used to send extra data along with the URL (ie. the contents of a form). However, this is terrible for search engines when they are crawling your page because they can't figure out where the URL points to and they can't index it.

There is some kind of operation in this link. If you loook at the code

return this.s_oc?this.s_oc(e):true

it is enabling and disabling the link. if condition s_oc true, then the link works else link not works. THis will help there own analytic purpose.

btw, in SEO aspect. href is the best visible to Search Engines. As because OnClick execute as Javascript function, Search Engines will not process this.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745218172a4617121.html

相关推荐

  • seo - javascript onclick based links? - Stack Overflow

    I have seen many websites includes apple and most of asp sites uses<a onclick='s_objectID="

    3小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信