: How can I create links in javascript that are crawlable by search engines? If I use JavaScript + jQuery, for example, does links inserted in $(document).ready() will be available for crawling?
If I use JavaScript + jQuery, for example, does links inserted in $(document).ready() will be available for crawling? How can I insert crawlable links in JavaScript?
More posts by @Si4351233
2 Comments
Sorted by latest first Latest Oldest Best
I use progressive enhancement so have the link in there in as a tags in the HTML which is then over ridden by the JavaScript. I suppose its also good for users that have JavaScript turned off (although I'm not really sure if people even do that any more.)
<ul>
<li><a href="index.html" id="show-services" >Our services</a></li>
<li><a href="about-us.html" id="show-about">About us</a></li>
</ul>
and then attach the AJAX content to the a tag ids
No, links inserted with Javascript will not be crawlable. You are better using a server-side solution to add links, i.e. output <a href="link">etc</a> direct in your HTML.
Having said that, search engines are always improving. Google recently announced major improvements to the crawling of Flash files, so it's not impossible that some Javascript links could be crawled. It does depend on the situation. Something simple like onclick="window.location='http://etc'" would probably be fine.
There is probably a better way to do what you are doing. If you provide more details (i.e. why you are using Javascript to add links), we may be able to offer better guidance. Perhaps you can output links in a hidden layer, and show them when needed? That way the links are in the raw HTML and will be crawled.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.