【发布时间】:2015-10-01 02:51:06
【问题描述】:
以下代码在控制台日志中显示成功,但在使用 Google 结构化数据测试工具或 G+ 分享按钮进行测试时失败。原始值保持不变。在这种情况下,“jack”永远不会更新为“jill”。
var newName= "jill"
$("h1").attr('itemprop','name').html(newName);
这是微数据:
<body itemscope itemtype="http://schema.org/Blog">
<div style="display:none;">
<h1 itemprop="name">jack</h1>
<img itemprop="image" src="http://somehewhere.com/something.png" />
<p itemprop="description">some text</p>
</div>
如您所见,只是试图将“jack”的值更改为“jill”。
【问题讨论】:
-
我不确定您是否可以假设搜索爬虫会使用 javascript。
-
进展如何? Googlebot 这些天不是更好地爬取 JS 吗? googlewebmastercentral.blogspot.com/2014/05/…
标签: jquery schema.org microdata google-rich-snippets