javascripthidesearch-enginepageloaddomready

Search engine crawler behavior regarding DOM ready state, page loaded state and script execution state


I have a Website with heavy jQuery action. In order to create a less chaotic page load I hide() the content container on initial page load and show() it when the page has loaded: $(window).load(function() { //show content...

This is the sequence right now, which works well in a browser for human eyes:

  1. hide content on initial page load.
  2. wait until page has fully loaded.
  3. show content.
  4. do jquery action.

But I wonder how this works for crawlers. Does the crawler wait for "page->loaded" and "scripts->finished"? If not, the crawl result may become messy..


Solution

  • First, hidden content is down-weighted in ranking, so your content might not perform as well as you'd like. You want to make absolutely sure that what search engines see is the finished, not-hidden-any-more content.

    You can look at what we (Google) "see" using Fetch and Render as Google in Search Console (former Webmaster Tools); read more about the feature in our post titled Rendering pages with Fetch as Google. If the rendered image looks right, you're good to go.