Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. To add Meta tag with javascript is good or bad for google search engine

To add Meta tag with javascript is good or bad for google search engine

Scheduled Pinned Locked Moved Web Development
javascriptquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shames Sam
    wrote on last edited by
    #1

    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

    S L M 3 Replies Last reply
    0
    • S shames Sam

      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

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S shames Sam

        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

        L Offline
        L Offline
        L Madhavan
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • S shames Sam

          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

          M Offline
          M Offline
          Mohammad Dayyan
          wrote on last edited by
          #4

          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>

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups