I understand that the question does not refer specifically to the Javascript language, but rather to the concept of running a language on the client, specifically in a web browser. In that sense, it seems that the answers went straight to the point.
There are several reasons why someone wants to run a language in client . Some are legitimate, others are not.
Usability, Interactivity, User Experience
Happy user continues to use the system and values the business.
- Immediate feedback
- Asynchronous information updates without user action.
- Interactivity: drag and drop, small animations, etc.
- User assistance, allowing you to perform actions with less effort: auto-complete fields, interactive menus, sliders , etc.
All this makes a lot of difference to whoever accesses a page. A news site, a photo gallery, all of this gets a lot better with Javascript.
For many this may seem like something superfluous. If you find this, argue with the founders of Google, Amazon, Facebook, Microsoft, Apple, etc.
Integration with local resources
Another area not so exploited is access to local resources, that is, they are in the user's station. Examples are scanners, bar code readers, mouse and keyboard.
Of course in most cases Javascript is not enough for this, but I'm referring to browser plugins or ActiveX components, for example.
Load balancing
More recently, with the rise of CSS, HTML5 and more powerful and fast browsers, many Rich Internet Application (RIA) applications have started to emerge, that is, they start to bring in much of the processing previously performed only on the server again for the client.
Centralization of processing seems to oscillate over the years. First everything was rendered in a mainframe and accessed via "dumb" stations. Then came the desktop and everything went to be distributed to the clients. Then came the web and went the other way. We go back to the "smart" server and the stations that only display and send data. We are at a more balanced point today. Most business rules run on the server, but the stations are increasingly "smart" in the sense that they are interactive and visually rich in functionality.
We have such good examples of such technologies as Google GWT or Cappuccino .
A GWT project, for example, is implemented in Java and has two main packages: client and server . The client part is converted to javascript and runs in the browser, usually responsible for all visual part and for RPC calls via interfaces to the part that is in the server . Virtually all Google products like Gmail, Drive and Calendar use this technology. The response to the user is much faster and the server is used for what really matters.
The Cappuccino project is a framework that almost totally abstracts the development of a web system. You develop in a language called Objective-J, which is a mixture of Javascript with Objective-C, to generate a rich application. The back-end or server should use some language to allow communication and data persistence, but the implementation is independent of this layer.