问题
Due to Googlebot's recent advances with interpreting JS, is it now possible to change schema.org microdata (ie. itemprop
) with jQuery?
There's a similar question here on SO: Is it possible to change Microdata itemprop with jQuery? -- but it was from before Googlebot's recent advances mentioned above.
回答1:
schema.org, RDF, Microdata, etc. are designed to provide context and information for machines. It provides them a means of accessing the information without having to execute client side code (i.e. JavaScript) and still be able to "understand" what you're talking about.
Even if google was able to understand your client side edits, it's not the only bot out there – others will not pick up these changes.
I'd suggest that you don't use client side code to edit information that's intended to be machine readable. Use it to display content to your users.
If you don't want to mess with your markup, have a look at JSON-LD.
You can easily test your markup with google's Structured Data Testing Tool.
来源:https://stackoverflow.com/questions/32872318/changing-schema-org-microdata-with-jquery