Load header and footer with . load() and make it visible to Google

Asked

Viewed 266 times

1

I’m setting up a pure HTML site, which has the following structure

site structure

Whereas I don’t have a Master Page like in ASP.NET, I need to replicate the header and footer to other pages using the function .load() jQuery, this way:

HTML

<div class="header">
</div>

<div class="content">
<span>Content goes here!</span>
</div>

<div class="footer">
</div>

JS

$(".header").load("header.html");
$(".footer").load("footer.html");

My problem is: when I use the tool Google Structured Data Testing Tool to analyze my site, the contents of the header and footer are not considered.

I’ve read about:

Pushstate and content loading via AJAX in links but this is not a good idea for me, considering that the replicated content is not activated by a link, but when the page loads.

Making AJAX Applications Crawleable but this article is discontinued.

I’m starting with SEO and things like that, so I have no idea how to load content asynchronously and get Google to find it.

Thank you!

  • I believe that as you are loading via JS, it will be complicated even. Which language you are using?

  • Hello @Jhonathan! I am using pure HTML, and JS only.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.