Copyright.js is a JavaScript plugin that updates the year in copyright. Here are some quick facts about Copyright.js.
- Automatically update the year in copyright text.
- You can specify the owner of the copyright.
- No jQuery dependency! Copyright.js is just good ol' JavaScript.
- Support multiple copyright texts appearing on a page.
- Support multiple copyright formats.
- Tiny file footprint. 1.5kb minified.
Copyright © 2014 Jason Kim
- Include
copyright.min.jsin theheadtag of the html file.<script src="copyright.min.js" type="text/javascript"></script> - Use utf-8. Add the following in the
headtag<meta charset="utf-8"> - Include the following in the desired location in the
bodytag.<div class="plugin-copyright" data-owner="[copyright-owner]"></div> - Replace
[copyright-owner]with the copyright owner name. - As a result, you should get something like
Copyright © 2014 Jason Kim
Formats
Format 1. Copyright © 2014 Jason Kim
Format 2. © 2014 Jason Kim
Format 3. Copyright 2014 Jason Kim
Format 4. © Copyright 1999 to the present, Jason Kim
Format 5. © 1999 - 2014 Jason Kim
Format 6. © Copyright 1999 - 2014 Jason Kim
- Include
copyright.min.jsin theheadtag of the html file.<script src="copyright.min.js" type="text/javascript"></script> - Use utf-8. Add the following in the
headtag<meta charset="utf-8"> - Include the following in the desired location in the
bodytag.<div class="plugin-copyright" data-owner="[copyright-owner]" data-format="[format-number]"></div> - Replace
[copyright-owner]with the copyright owner name. - Replace
[format-number]with the copyright owner name. If you are using format 4 or 5 or 6, you must specifydata-beginning. So your copyright div should look like the following.<div class="plugin-copyright" data-owner="[copyright-owner]" data-format="[format-number]" data-beginning="1999"></div>
Check example.html for more examples.
- Raise an issue
- Label the issue as a bug.
- Describe the bug and detail how you can reproduce the bug. Make sure to report OS and browser with the version number you are using.
- Raise an issue
- Label the issue as a feature.
- Describe the feature.
- Fork the repository.
- Make code changes.
- Test the changes.
- Make a pull request.
Copyright.js is released under the MIT License.