www.webdeveloper.com
Results 1 to 8 of 8

Thread: Canonical Tags - Javascript

  1. #1
    Join Date
    May 2011
    Location
    England, UK
    Posts
    8

    Canonical Tags - Javascript

    Hey Guys,
    Would it be possible to use javascript to place canonical tags on each on of my pages, to save me adding them all individually?

    Kind Regards
    Paul

  2. #2
    Join Date
    May 2011
    Location
    England, UK
    Posts
    8
    I mean an dynamic / automatic canonical tag to save me writing an indiv one for each 100+ pages

  3. #3
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,412

    Question

    Quote Originally Posted by paulmozzie View Post
    I mean an dynamic / automatic canonical tag to save me writing an indiv one for each 100+ pages
    What is a cononical tag?
    Can you give an example?

  4. #4
    Join Date
    Jan 2005
    Posts
    369

    Cool

    Yes, and no.

    You can use JavaScript to add this to a page after it had loaded, but that means that the main search engines will never see it, which probably defeats the purpose of it...

  5. #5
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,412

    Question

    Quote Originally Posted by JMRKER View Post
    What is a cononical tag?
    Can you give an example?
    Quote Originally Posted by omnicity View Post
    Yes, and no.

    You can use JavaScript to add this to a page after it had loaded, but that means that the main search engines will never see it, which probably defeats the purpose of it...

    Yes, and No ... What does that mean?
    What is the "this" that you are adding to a page?

  6. #6
    Join Date
    Oct 2007
    Location
    Western Massachusetts, USA
    Posts
    387
    example taken from http://googlewebmastercentral.blogsp...anonical.html:
    HTML Code:
    <link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />
    Sounds like using server-side technology would help you a lot more; most web crawlers do not support javascript, thus it will in all probably work with very few search engines. You could, however, write a Perl script or something similar to walk through a list of files and add in the tag manually.

  7. #7
    Join Date
    May 2011
    Location
    England, UK
    Posts
    8
    Quote Originally Posted by savvykms View Post
    example taken from http://googlewebmastercentral.blogsp...anonical.html:
    HTML Code:
    <link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />
    Sounds like using server-side technology would help you a lot more; most web crawlers do not support javascript, thus it will in all probably work with very few search engines. You could, however, write a Perl script or something similar to walk through a list of files and add in the tag manually.
    Thank you, so reading through these threads it is possible to create an automated canonical tag but they might not work?

  8. #8
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,412

    Exclamation

    Quote Originally Posted by paulmozzie View Post
    Thank you, so reading through these threads it is possible to create an automated canonical tag but they might not work?
    Quote Originally Posted by JMRKER View Post

    Yes, and No ... What does that mean?
    What is the "this" that you are adding to a page?
    I find it difficult to determine if I can help when you ask questions, but don't respond to ours.
    The links posted also are broken.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles