admin管理员组

文章数量:1317565

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 = ".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)?

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./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)?

Share Improve this question asked Oct 3, 2011 at 19:58 vovafeldmanvovafeldman 60512 silver badges17 bronze badges 3
  • Duplicate of stackoverflow./questions/2434445/…? – Clive Commented Oct 3, 2011 at 20:02
  • 1 Don't know the answer to your question, tough your page should have full content and be browsable even without scripts. – Ortiga Commented Oct 3, 2011 at 20:04
  • No, it's not a duplicate - it's a different scenario. – vovafeldman Commented Oct 4, 2011 at 13:04
Add a ment  | 

2 Answers 2

Reset to default 6

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

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./test/google-json-ld-and-javascript-crawling-and-indexing-test.html

本文标签: javascriptDoes Google39s crawler index asynchronously loaded elementsStack Overflow