Motores de búsqueda y código javascript al hacer clic en un hipervínculo

I create a HTML link like this.

<a href='http://www.mywebsite.com/aPage' onclick='customFunc(); return false;'>Show Info</a>

I'm writing an ajax functionality (in customFunc) when this link is clicked and displaying data which is same as the data shown by the link in HREF tag.

Question: When search engines see my link, will they cache it? Or will they get an impression that I'm trying to do a false magic to get this page cached, and hence ignore it?

Aprecia tus sugerencias.


Editar: So what I interpret from this Q & A is that, (theoretically) search engines are just bothered about the href, and since it found one in the above link - it will cache this page without any troubles and it won't be worried about the things I do in the onclick JS call.

If anyone has a different opinion, please do add your comments.

preguntado el 24 de agosto de 12 a las 08:08

2 Respuestas

Spiders will automatically follow each anchor in your page. If you want to avoid this behavior you have to specify Rel = "nofollow" for "a" tags you want to skip. You can also avoid indexing of whole pages using meta tags or robots.txt. Anyway attached event listeners are theoretically irrelevant to search engine... I took a look the SEO guide lines from google here: http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf and I did not read about a scenario like your.

Respondido 24 ago 12, 08:08

It's also worth noting that as of recently, the Google bot also follows text URLs - they don't even have to be HTML anchor tags, just a URL in your text will get indexed. Annoying to the nth. - Zenkaty

I need this link to be cached. My idea is to make a quick ajax display of the info when the user clicks this link and at the same time make the same info available when opened as a link (from a search engine's results page) - Harsh ..

Adición nofollow won't stop a bot from following the link. It will just prevent the link for contributing page rank to the page at the other end. - Quentin

Solo recuerda que el rel="nofollow" does not guarantee that search engines will not follow. If you don't want that link is followed, it is advisable to use with <span> con onclick() to link (which also isn't 100% guaranteed). - Shankar Cabú

you are right... SEO is alchemy, there are no guarantees, but only reasonable suppositions :P - daveoncode

Although search engines like Google now interpret some javascripts, in this case, it will clearly see the href and not see the rel="nofollow".

Respondido 24 ago 12, 13:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.