Results 1 to 3 of 3

Thread: Auto Copyright year script

  1. #1
    Join Date
    Sep 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Auto Copyright year script

    Hello,

    I have found the following javascript for automatically generating for copyright year on a web page:

    <script type="text/javascript">
    copyright=new Date();
    update=copyright.getFullYear();
    document.write("Copyright © 2001-"+ update + " (your company name) All rights reserved.");
    </script>

    However, my question is: instead of writing this script on every single webpage, how could I save this script on an external .js page and call it into every webpage?

    Many Thanks

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Don't bother. Pages have any immediate copyright unless explicitly stated otherwise. The whole copyright notice on webpages is just to "scare" away potential thiefs and will look perfectly valid without the year

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    That script has the delightful side effect of displaying no copyright notice at all to the non-JS user.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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