Is it possible to change Microdata itemprop with jQuery?

岁酱吖の 提交于 2019-12-07 00:14:27

The html() method cannot be used on the itemprop attribute. You need to apply it to just the h1 tag instead:

$("h1[itemprop=name]").html(newName);

or since newName is simple text:

$("h1[itemprop=name]").text(newName);

That's because GoogleBot (and all the others, for that matter) doesn't execute (all) javascript. You won't have any success setting or changing microdata properties by any client side script.

Changing microdata values was no sense, since as dwtm.ts said, bots don't execute javascript and parse only source code downloaded directly when they get the pages. You should use "fetch as googlebot" test tool from GWT to check how search bots "read" your page.

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