Skip to content Skip to sidebar Skip to footer

Add Microdata Using Javascript

I have a rating system based on Javascript and php. On each page is displays the result 'X votes (moyenne X)'. X are numbers and 'moyenne' means 'average notation'. I want the java

Solution 1:

My understanding is that Google and other microdata consumers will not pick up the information if it is added by Javascript. I think it needs to be present in the actual HTML markup.

Google states on various support pages that crawlers see only the content that is visible to a text browser, or a browser with Javascript turned off; I'm assuming that it's no different when Microdata is involved. See here and here for example.


Solution 2:

only Opera n FF supports the MicroData JS.

<span itemprop="reviewCount">X</span> (Moyenne <span itemprop="ratingValue">X</span>)

Here is ur JS Code

var span = document.createElement("span");
span.itemProp = "reviewCount";
span.src = "http://example.org/example.jpg";
span.itemValue = X;

var span1 = document.createElement("span");
span1.itemProp = "ratingValue";
span1.src = "http://example.org/example.jpg";
span1.itemValue = X;

Post a Comment for "Add Microdata Using Javascript"