How can I legally use LGPL javascript in a commercial web site?

TeddyB picture TeddyB · Jan 6, 2010 · Viewed 31.4k times · Source

My understanding is that with LGPL, can I link and use an LGPL library for commercial use, as long as I don't copy code?

That make sense for programs you compile to binary, but what about JavaScript?

I want to use the Greybox plugin for JQuery in my commercial website but don't know how to do that legally since it's LGPL.

Answer

Brian Campbell picture Brian Campbell · Jan 6, 2010

The LGPL basically requires (read the full license and FAQ for details):

  1. You mention that it is licensed under the LGPL, with reference to the full license.
  2. That you distribute the code, and any changes to it, under the terms of the LGPL. You must release the source code in it's preferred form (not minified or obfuscated), including any changes that you make to it.
  3. That it is dynamically linked in to your application in such a way that the user can replace it with their own version if they want.

(this is a very brief overview of the requirements, as they would apply to your situation; as I said, see the license and FAQ for more details)

To comply with (1), see the "Appendix: a convention for releasing free JavaScript programs" in the article The JavaScript Trap for a proposed convention for how to mention and link to the license of a JavaScript program.

To comply with (2), you could just serve the code up as-is. If you need to minify the code for performance reasons, you should include a link in a comment to the un-minified version of the code.

To comply with (3) in JavaScript, as long as you keep the code in a separate script file, and don't merge it into one file with your code, you should be fine. Anyone who wants to replace it could use Greasemonkey or UserJS to do so.