To add Meta tag with javascript is good or bad for google search engine
-
I want to add Meta tag of page at runtime by javascript. my question is good or bad for google search engine :doh:
Web Developer
-
I want to add Meta tag of page at runtime by javascript. my question is good or bad for google search engine :doh:
Web Developer
It really depends on why you're adding the meta tag in the first place! Google does not put much stock in most meta tags to begin with, so it shouldn't make much difference... unless the sole reason you're adding the tag is for SEO, in which case generating it in a client script is just silly. Keep in mind, most browsers will ignore runtime-generated meta tags anyway, so you may not be accomplishing anything at all...
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
-
I want to add Meta tag of page at runtime by javascript. my question is good or bad for google search engine :doh:
Web Developer
It makes no sense to add META tags using JavaScript because search engines do not evaluate scripts and hence they will never see those tags.
-
I want to add Meta tag of page at runtime by javascript. my question is good or bad for google search engine :doh:
Web Developer
You can do it , but it makes no difference . Like this :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" language="javascript">
function meta1()
{
//<![CDATA[
var var1 = document.getElementsByTagName('head').item(0);
var1.innerHTML += '<meta http-equiv=
"Content-Type" content="text/html; charset=utf-8" />';
alert(var1.innerHTML);
//]]>
}
</script>
</head>
<body>
<script type="text/javascript" language="javascript">meta1();</script>
</body>
</html>