<!--#include virtual="/server/header.html" -->
<!-- Parent-Version: 1.77 -->
<title>JavaScript License Web Labels - GNU Project - Free Software Foundation</title>
<!--#include virtual="/licenses/po/javascript-labels.translist" -->
<!--#include virtual="/server/banner.html" -->

<h2>JavaScript License Web Labels</h2>

<p>If you are a webmaster deploying minified JavaScript on a site,
here's a method for stating their licenses and source code locations
without altering the minified files themselves.  It's especially helpful in cases where
the JavaScript is under one of the GNU licenses, but does not include
the exception additional permission proposed in <a href="/philosophy/javascript-trap.html#AppendixA"> Appendix A Section 3.2 of
“The <em><a
href="/software/librejs/free-your-javascript.html">Setting Your
JavaScript Trap.”</a>
</p> Free</a></em>, by Loic Duros.</p>

<p>The JavaScript license web labels method is meant for files of
minified JavaScript code.  This method complies with the relevant
conditions in the GNU software licenses, and it enables LibreJS to
confirm the correctness of the information on a site.</p>

<p>Using web labels presumes that the corresponding JavaScript source
files carry license notices that properly release them under a free
license.  The compiled code isn't free unless its source code is, and
indicating the license is essential for proper release of free source
code.  If you haven't done that, you should do that first.</p>

<p>You can use web labels on non-minified JavaScript files too, to
indicate their licenses in a way a program can recognize; but these
are source files, so please don't fail to give them human-readable
license notices.  Omitting those notices creates uncertainty about
these files legal status.</p>

<p>The web labels method is not applicable to inline JavaScript
included directly in HTML pages — their license information
should be <a href="/philosophy/javascript-trap.html#AppendixA"> stated href="/software/librejs/free-your-javascript.html">stated
directly in those pages</a>.</p>

<p>For more
explanation of why we designed this format, see the
<a href="/licenses/javascript-labels-rationale.html">rationale</a>.</p>

<h3>Writing the labels page</h3>

<p>Add a page for JavaScript license web labels to your site.  You can
use whatever path or filename is most convenient for you; others will
find it through links.  The page must include one table marked with
the attribute <code>id="jslicense-labels1"</code>.  This name lets
automated tools find the table easily, and tells them what format to
expect.  Each row of this table will contain three cells, providing
information about a standalone JavaScript file used on the site, its
license, and how visitors can obtain its source code.</p>

<p>The first cell of each row names a JavaScript file used by the
site.  The cell must contain an anchor tag that links to that file,
just as
<code>script</code> tags throughout the site do.</p>

<p>The second cell provides information about the license of this
JavaScript file.  The cell must contain an anchor tag whose link
refers to the full license text, and whose text provides the license's
full name, and if the license has multiple versions, the version
number and whether or not the file is licensed under later versions of
the license.  Good license identifiers and their associated links
are:</p>

<ul>
<li><a href="/licenses/gpl-2.0.html">GNU-GPL-2.0-or-later</a></li>
<li><a href="/licenses/gpl-3.0.html">GNU-GPL-3.0-or-later</a></li>
<li><a href="/licenses/lgpl-2.1.html">GNU-LGPL-2.1-or-later</a></li>
<li><a href="/licenses/lgpl-3.0.html">GNU-LGPL-3.0-or-later</a></li>
<li><a href="/licenses/agpl-3.0.html">GNU-AGPL-3.0-or-later</a></li>
<li><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache-2.0-only</a></li>
<li><a href="http://directory.fsf.org/wiki/License:BSD_3Clause">Modified-BSD</a></li>
<li><a href="http://creativecommons.org/publicdomain/zero/1.0/legalcode">CC0-1.0-only</a></li>
<li><a href="http://www.jclark.com/xml/copying.txt">Expat</a></li>
<li><a href="http://www.mozilla.org/MPL/2.0">MPL-2.0-or-later</a></li>
</ul>

<p>The third cell provides a link to the JavaScript's source code.
The source code file can be a single, unminified JavaScript file, a
<code>.tar.gz</code> archive, or a <code>.zip</code> archive.  If a source archive includes
multiple JavaScript files, the archive must include a file named
<code>00-INDEX</code> that lists the order in which individiual source files
should be concatenated to produce a single file that's
equivalent to what's hosted on the site.  If the JavaScript as it's
served from the site, and linked from the first cell, is already in
source code form, link to the same URL again in this cell.</p>

<p>Below is an example table for illustration.  This site just uses
one JavaScript file: a minified version of jQuery 1.7, distributed
under the Expat license.  The table lists the file with corresponding
license information and a link to full source code:</p>

<pre><code><table id="jslicense-labels1">

<tr>
<td><a href="/js/jquery-1.7.min.js">jquery-1.7.min.js</a></td>

<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>

<td><a href="/js/jquery-1.7.tar.gz">jquery-1.7.tar.gz</a></td>
</tr>

</table>
</code></pre>

<p>This page may include other text and markup, including your site's
normal layout and navigation tools, but the table must be displayed
prominently on it.</p>

<h3>Links to the labels page</h3>

<p>On each page that uses JavaScript, include a link that points to
the labels page described above.  Mark this link with the
attribute <code>rel="jslicense"</code>, so that automated tools can
find it.  For example, your final link might look like this:</p>

<pre><code><a href="/about/javascript" rel="jslicense">JavaScript license information</a>
</code></pre>

<p>This link can be small, but it should be clearly visible to people
who visit your site.</p>

<h3>Notes</h3>

<p>If you do these things, you will comply with the relevant
conditions in the GNU software licenses, such as the GNU General
Public License.  They should also suffice to comply with many other
free software licenses, but we can't say with certainty that they will
comply with all of them.  As always, please make sure you understand
and follow the license conditions of any free software you
distribute.</p>

</div><!-- for id="content", starts in the include above -->
<!--#include virtual="/server/footer.html" -->
<div id="footer">
<div class="unprintable">

<p>Please send general FSF & GNU inquiries to
<a href="mailto:gnu@gnu.org"><gnu@gnu.org></a>.
There are also <a href="/contact/">other ways to contact</a>
the FSF.  Broken links and other corrections or suggestions can be sent
to <a href="mailto:webmasters@gnu.org"><webmasters@gnu.org></a>.</p>

<p><!-- TRANSLATORS: Ignore the original text in this paragraph,
        replace it with the translation of these two:

        We work hard and do our best to provide accurate, good quality
        translations.  However, we are not exempt from imperfection.
        Please send your comments and general suggestions in this regard
        to <a href="mailto:web-translators@gnu.org">
        <web-translators@gnu.org></a>.</p>

        <p>For information on coordinating and submitting translations of
        our web pages, see <a
        href="/server/standards/README.translations.html">Translations
        README</a>. -->
Please see the <a
href="/server/standards/README.translations.html">Translations
README</a> for information on coordinating and submitting translations
of this article.</p>
</div>

<!-- Regarding copyright, in general, standalone pages (as opposed to
     files generated as part of manuals) on the GNU web server should
     be under CC BY-ND 3.0 US. 4.0.  Please do NOT change or remove this
     without talking with the webmasters or licensing team first.
     Please make sure the copyright date is consistent with the
     document.  For web pages, it is ok to list just the latest year the
     document was modified, or published.
     
     If you wish to list earlier years, that is ok too.
     Either "2001, 2002, 2003" or "2001-2003" are ok for specifying
     years, as long as each year in the range is in fact a copyrightable
     year, i.e., a year in which the document was published (including
     being publicly visible on the web or in a revision control system).
     
     There is more detail about copyright years in the GNU Maintainers
     Information document, www.gnu.org/prep/maintain. -->

<p>Copyright © 2015 2015, 2017 Free Software Foundation, Inc.</p>

<p>This page is licensed under a <a rel="license"
href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
href="http://creativecommons.org/licenses/by-nd/4.0/">Creative
Commons Attribution-NoDerivs 3.0 United States Attribution-NoDerivatives 4.0 International License</a>.</p>

<!--#include virtual="/server/bottom-notes.html" -->

<p class="unprintable">Updated:
<!-- timestamp start -->
$Date: 2017/05/27 11:58:58 $
<!-- timestamp end -->
</p>
</div>
</div>
</body>
</html>