English [en]   français [fr]   日本語 [ja]   русский [ru]  

Meet the GNU contributors in person at the GNU Hackers' Meeting!

The 8th GNU Hackers' Meeting takes place in Munich, Germany from 15–17 August 2014. It spans three days, and comprises talks about new GNU programs, status of the GNU system and news from the free software community.

Register now to secure your place.

JavaScript License Web Labels

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 those files. It's especially helpful in cases where the JavaScript is under one of the GNU licenses, but does not include the exception proposed in Appendix A of “The JavaScript Trap.” This method presents the information prominently enough to comply with the relevant conditions in the GNU software licenses, and it's specific enough that software can confirm the correctness of the information on a site. For more explanation of why we designed this format, see the rationale.

The JavaScript license web labels method is meant for files of minified JavaScript code. You can also use it for non-minified JavaScript source files if you wish; but if you're not aiming to make the files small, you might as well put a copy of the license in the source file.

The web label method is not applicable to inline JavaScript included directly in HTML pages — their license information should be stated directly in those pages.

Writing the labels page

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 id="jslicense-labels1". 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.

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 script tags throughout the site do.

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:

The third cell provides a link to the JavaScript's source code. The source code file can be a single, unminified JavaScript file, a .tar.gz archive, or a .zip archive. If a source archive includes multiple JavaScript files, the archive must include a file named 00-INDEX 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.

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:

<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>

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.

Links to the labels page

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

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

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

Notes

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.

 [FSF logo] “Our mission is to preserve, protect and promote the freedom to use, study, copy, modify, and redistribute computer software, and to defend the rights of Free Software users.”

The Free Software Foundation is the principal organizational sponsor of the GNU Operating System. Support GNU and the FSF by buying manuals and gear, joining the FSF as an associate member, or making a donation, either directly to the FSF or via Flattr.

back to top