A
A
Andrey Astafiev2015-07-24 15:36:04
JavaScript
Andrey Astafiev, 2015-07-24 15:36:04

Does the crawler index head tags added with Jquery?

At the end of the page I add title and description how will the search robot react to this? Will it add these values ​​to the database, and if not, how to fix the situation?

$(document).ready(function(){
        $("head").append("<title>Название страницы</title>");
  $("head").append("<meta name='Description' content='Описание'>");
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Леша Федосеев, 2015-07-24
@alexfedoseev

Google bot has already learned how to render JS, it has indexed one of my SPAs without server rendering, and it lives quietly in the search results (although, I believe that it still gives priority to sites with standard html from the server).
But I do not recommend calming down with this thought, because the snippet from the question is the road to hell. The future is isomorphic/universal javascript. And the initial html should arrive at the client from the server. Therefore, the answer to the question of how to fix the situation is this: stop doing `$("head").append`, and start delving into modern approaches to web development.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question