Does Google's crawler index asynchronously loa

2019-06-26 03:37发布

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

2条回答
Deceive 欺骗
2楼-- · 2019-06-26 03:57

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

查看更多
Ridiculous、
3楼-- · 2019-06-26 04:07

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

查看更多
登录 后发表回答