Open Source Licensing – Is Any JavaScript Code Used Only for Websites Open Source?

commercialgpllicensingopen source

Rewritten question:

I'm not asking a JavaScript-related question, but all "client" languages used on the web (HTML5, JavaScript, CSS, and so on). If I put JavaScript code (that is GPLed) on my website, and this website is accessible from anyone over the web, am I violating the GPL in some way?

What happens if I would like to sell the client-code (HTML, CSS, JavaScript) to someone? Do I need a different license in this case?

Isn't JavaScript (when used for websites) always open source? When you open a webpage you can always read the source.

Do I also need to release my server-side code if I'm selling a website which contains JavaScript GPLed code?

What happens if this website is partially accessible (a part is free and the other requires you to pay) but the GPLed code (the same part) is used on both sides of the website?

What if the GPLed code is only in a part of the website that requires you to pay to access it?

If I'm selling a website to a customer in this way:

  1. I'm selling you (one time fee) all client-related code (JavaScript, HTML and CSS)
  2. I'm not selling you the server-side code, you're renting it (I don't want to let you reuse my server-side code)

If I'm using some JavaScript GPLed code, am I violating something? (The website is accessible from anyone over the web.)

Edit 2:

Added a new specific question:

What if the website can work without server-side code, I mean, JavaScript is just calling some PHP pages that contains data in JSON format. Other people can build a website with the client side, but they will need to provide data. In this case JavaScript is calling the "PHP" code (but not the opposite) I think. In this case, am I violating GPL?

Best Answer

When it comes to GPL, the unit of release is the unit of licensing.

If your web site, and its javascript are a single thing that works together, then the whole has an effective license. If any part is GPL, the effective license of the whole is GPL. (This is not true for LGPL, MIT, etc.)

If you are hosting the web site, and your customers are buying access to the service, then you have not distributed or conveyed the server side code, thus the GPL is irrelevant. (The AGPL changes this, and asserts that Software as a service must have its source released.)

Javascript that is part of your application in not automatically licensed in any way. Strictly speaking, downloading the javascript to run it in the browser is copyright infringement. Of course, that is silly. There's probably an implied license to run the code, but that is all.

If you use a Javascript library, then you have to obey the license of that library. If that license is GPL, my understand is that that means your whole application is GPL. This is probably why jQuery has a dual license -- your choice, MIT or GPL. Without the option to use the MIT license, it could only be used by GPL apps.

Related Topic