可以javascript document.write
头部元素seo?
我有动态页面,所以我想逐页加载不同的头部元素。
首先,我尝试了jquery,但是jquery无法在源代码中输入单词。那么document.write
怎么样?
jquery代码:但不能在源代码中打印。
$('#metad').attr('content','Top productions '+ seoword + '');
$('#metak').attr('content','Top productions, '+ seoword + '');
<meta name="description" id="metad" content="Top productions" />
<meta name="keywords" id="metak" content="Top productions" />
答案 0 :(得分:2)
您不能使用JavaScript修改SEO的页面内容。大多数时候(所有时间?)机器人都不会运行JavaScript代码,因此会在发生任何JavaScript更改之前看到您的页面。