Mobile app version of vmapp.org
Login or Join
Sent6035632

: Does using onclick on div's effect SEO? I have a few elements on my page that uses onclick as the link, e.g: <div class="service" onclick="location.href='<?php echo $fields->service_1_link;

@Sent6035632

Posted in: #Accessibility #Html #Javascript #Seo

I have a few elements on my page that uses onclick as the link, e.g:

<div class="service" onclick="location.href='<?php echo $fields->service_1_link; ?>'" style="cursor:pointer;">
<img class="service" src="<?php echo $fields->service_1_image; ?>" alt="<?php echo $fields->service_1_name; ?>" height="111" width="299" border="0" />
<div class="service-title"><h2><?php echo $fields->service_1_name; ?></h2></div>
</div>


Does this have an impact on crawlers and SEO over say a normal link?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sent6035632

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

This is Google's answer: www.google.com/support/webmasters/bin/answer.py?answer=81766

When creating your links, format them
so that they'll offer a static link as
well as call a JavaScript function.
That way you'll have the AJAX
functionality for JavaScript users,
while non-JavaScript users can ignore
the script and follow the link. For
example:


<a href="ajax.htm?foo=32" onClick="navigate('ajax.html#foo=32'); return false">foo 32</a>



Note that the
static link's URL has a parameter
(?foo=32) instead of a fragment
(#foo=32), which is used by the AJAX
code. This is important, as search
engines understand URL parameters but
often ignore fragments. Since you now
offer static links, users and search
engines can link to the exact content
that they want to share or reference.

While we're constantly improving our
crawling capability, using HTML links
remains a strong way to help us (as
well as other search engines, mobile
devices and users) better understand
your site's structure.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme