user1009453
user1009453

Reputation: 707

Appended h1 tag not recognized

I have this page where I append my h1-tag with jquery like:

  $('.name').append('<h1 style="margin-bottom=20px;">' + name +'</h1>');

The h1 tag, and the content of the tag, displays nicely, but when I test my page in various seo tools ( for example this one: http://www.seositecheckup.com/) I get the message that the page has no h1 tag.

Which of course is not so good from a seo point of view. Does anyonme recognize this problem? On a similar note: On the homepage I print out a list with with a javascript for loop and append the listing html and content:

    $('#list').append("<div class='point'><a href='" + str + "&id=" + id + "' onmouseover='infoShow(" + i + ")'  onmouseout='infoClose(" + i + ")'><H3>" + titel + 
"</H3></a><div class='address'>" + name + "</div>" + trivsel + "<div class='star"+i+"'></div></div></a>");    

I looks fine on the page, but when I look at googles cahced version of the site, the listing is not there and the page looks blank.

Upvotes: 2

Views: 336

Answers (2)

vinczemarton
vinczemarton

Reputation: 8156

What are you expecting? The "different seo tools" like the one you linked does not execute any javascript (usually). They work with the original state of your HTML.

Upvotes: 1

Blender
Blender

Reputation: 298392

Web crawlers don't execute your JavaScript, so the <h1> tag isn't created. If you want this tag to be visible to web crawlers, you need to generate it with your serverside language.

Upvotes: 4

Related Questions