Changing schema.org microdata with jQuery?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 05:24:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!