0

I have a javascript code on my site who displays links from another site.

This is what I have on my source before:

<script language="JavaScript" type="text/javascript">showLink(1);</script>

This is what I have copied from my source after the page has loaded:

<script language="JavaScript" type="text/javascript">showLink(1);</script><a rel="nofollow" target="_blank" class="anc" href="http://x5.external_site.net/sc/out.php?s=5483&amp;o=http%3A%2F%2Fwww.bluetooth.com">Bluetooth Devices</a>

Can google see this link?

1

Probably. Search engines can read basic JavaScript so this seems simple enough for them to read and understand. if you don't want them to read and understand it then block the JavaScript file using robots.txt.

FYI, if you are doing this for SEO purposes this is considered black hat SEO and could potentially get you penalized up to and including banned.

  • The question should have been - can google read external javascript. Because what showLink(1); does is gets the info from an external site and writes it in my page. But I'm not sure if it's doing it after the dom has loaded; and why does the rest of the code appear in my source after the DOM – webmasters Jul 20 '12 at 12:56
1

GoogleBot now interprets JavaScript and can see the page layout after all JavaScript is processed, so yes they can see that!

1

Yes as long as the <a> with href attribute is being rendered on the page it's going to be found by Google this is a regular link and how it ended up on your page doesn't really matter.

Google can render JavaScript all JavaScript how much they can understand is anyone's guess considering how varying code can be written. But they're surely looking for links and however they're created if it ends up being an <a> I would assume they see it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.