将下面的代码写成调用并且显示出数据html显示到页面 script data-react-helmet=true type=applicationld+json context httpsschemaorg type BreadcrumbList itemListElement t
<html>
<head>
<title>示例</title>
<script data-react-helmet="true" type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "抖音",
"item": "https://www.douyin.com"
},{
"@type": "ListItem",
"position": 2,
"name": "PPT之神",
"item": "https://www.douyin.com/user/MS4wLjABAAAA0C2JbrxnSTOwABi8POWTMj6xdD0ONNpV_0S3NiM0RsXzdxxiO87MHlfa7WfURQ1q"
}]
}
</script>
</head>
<body>
<script type="text/javascript">
var script = document.querySelector('script[data-react-helmet="true"]');
console.log(JSON.parse(script.textContent));
</script>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/Mqz 著作权归作者所有。请勿转载和采集!