Answer the question
In order to leave comments, you need to log in
How to make a page fragment loaded via JS be indexed?
Hello.
There is JS that loads an important block with internal site links on the page.
document.addEventListener('DOMContentLoaded', function() {
var add = document.querySelector('#add');
add.innerHTML = '<a href="/hello_world">Hello world!</a>';
});
Answer the question
In order to leave comments, you need to log in
Possible:
1. JS loaded after the crawler scanned the page. Try to move the code as high as possible.
2. JS files are closed for scanning.
Look in the google webmaster console in the "View as GoogleBot" report
AJAX-not AJAX is not the issue. Need to execute JS. Search engines and social networks don't do that. They index the html that arrived in response to the request and that's it. To execute JS, you can use a service that does this, for example, renderjs.io
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question