Does Google's crawler index asynchronously loaded elements?
Asked Answered
O

2

5

I've built some widget for websites which is asynchronously loaded after the page is loaded:

<html>
    <head>...</head>
    <body>
        <div>...</div>

        <script type="text/javascript">
            (function(){
                var ns = document.createElement("script");
                ns.type = "text/javascript"; 
                ns.async = true;
                ns.src = "http://mydomain.com/myjavascript.js";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(ns, s);
            })();
        </script>
    </body>
</html>

Is there anyway to notify Google's crawler to index the page only after the page is fully loaded (after the async JavaScript modified the HTML)?

Outage answered 3/10, 2011 at 19:58 Comment(3)
Duplicate of #2434945?Hildehildebrand
Don't know the answer to your question, tough your page should have full content and be browsable even without scripts.Reposit
No, it's not a duplicate - it's a different scenario.Outage
I
6

No. You have to set up static mirror pages for asynchronous content. See here: http://code.google.com/web/ajaxcrawling/docs/getting-started.html

Interact answered 3/10, 2011 at 20:0 Comment(0)
A
4

Things have evolved since then:

  • Google crawls and indexes all content that was injected by javascript.
  • Google even shows results in the SERP that are based on asynchronously injected content.
  • Google can handle content from httpRequest().

(...)

  • Dynamically updated meta elements get crawled and indexed, too.

Source: http://www.centrical.com/test/google-json-ld-and-javascript-crawling-and-indexing-test.html

Agripina answered 13/4, 2016 at 6:56 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.