The closure of the indexing means of jQuery ajax. How does it work?

Trying to close from indexing by search engines some blocks on the site. Do this:
  1. Connect the jquery (tried in head and in the code)
    <script src="https://yastatic.net/jquery/3.1.1/jquery.min.js"></script>

    Immediately a problem arises. Breaks the layout. There is a suspicion that this is due to the fact that somewhere already connected to another version. Could it be because of this or the problem lies elsewhere?
  2. Then need to close the bet id (ideasnike) and load this design
    <div id="noindex"></div>
    the <script>
    $(function() {
    $('#noindex').load('/')
    })
    </script>

    Where "#noindex" selector block and " / " is the url of the page


The question itself where you can check if it is not closed from indexation and this unit is not visible to the search engines?
And what to do to layout sailed after connecting jQuery?
June 3rd 19 at 21:00
1 answer
June 3rd 19 at 21:02
Figured out myself. Maybe someone will be useful.

  • The layout moves down because it connects the whole home through .load('/') and not the item code that you need.
  • You can check by going into the code ctrl+u , there must be an empty block with the id, and plug (hidden) element will still be present on the site.


Describe on steps connection.

  1. Create a file on the server with the code block you want to hide and extension .php for example noindex.php

  2. Plug him in the head design
    <script type="text/javascript">
    $(document).ready(function() {
    $("#noindex").load("/noindex.php");
    });
    </script>

    Where:
    "#noindex" selector block which should not see a search engine
    "/noindex.php" the path to the file where our code block

  3. Deduce template empty block with ID <div id="noindex"></div>
  4. The connection is successful if the code empty block <div id="noindex"></div> , but the elements themselves present on the website and displayed.

Find more questions by tags jQueryAJAXSearch engine optimization