What is JavaScript?
JavaScript is by definition a programming language in the broader sense and a scripting language in the narrower sense, as the name already implies. It is one of the most popular programming languages besides PHP and is mainly used in web development. The largest area of application of JavaScript is the design of the front end of websites and progressive web apps. JavaScript was developed in 1995 by Netscape with the aim of a dynamic extension of HTML. HTML is not a programming language, but a syntax for structuring the electronic document of a website, which is displayed by the browser.
Is it related to Java?
Despite the similarity of names, the programming languages Java and JavaScript are fundamentally different. The original name LiveScript was renamed to JavaScript due to a cooperation with Sun Microsystems, as the integration of Java applets of the cooperation project was carried out using LiveScript and the developers promised themselves a market advantage from the popularity of Java.
Object-based programming with JavaScript
If JavaScript is used, the structuring of the program is organized via objects that allow data and functionalities to be encapsulated. JavaScript is therefore also defined as an object-based programming language, but unlike Java or C#, it is considered non-object-oriented due to the lack of classes, as well as functions of inheritance and polymorphism. The interface between HTML and dynamic JavaScript is also called DOM (Document Object Model).
How JavaScript Works
JavaScript is considered a client-side scripting language. Client-side means that the scripts, i.e. the JavaScript programs, are interpreted by the browser used and executed in the form of processor instructions on the user’s computer. This is different, for example, from PHP or Perl scripts that run directly on the web server.
This property of JavaScript is mainly used for dynamic HTML. In the background of every website is an HTML document. If a user-side action is performed, for example, filling out a form or clicking on an element, JavaScript makes a change to the HTML document displayed in the browser window. The document on the web server remains unaffected by this, it can only be edited in the browser or in RAM, i.e. in the main memory of the computer. The change can affect both the content and graphic elements. The advantage lies above all in the flexibility and responsiveness of user actions and inputs, since no new document has to be loaded from the server for additional information or elements and the document becomes interactive – and thus dynamic. It is not for nothing that JavaScript also plays a major role in responsive web design, which has set itself the goal of presenting web content appropriately on any screen size and reacting flexibly to user actions.
Areas of application of JavaScript
The largest area of application of JavaScript is the frontend in web development. Today, almost every website uses JavaScript in one place or another in addition to HTML and CSS. In contrast to HTML and CSS, however, JavaScript is not absolutely necessary for the operation of a website, on the contrary, it should even be the goal that a website is so stable that it is fully functional even if JavaScript is not activated. If errors creep into the code, however, they can lead to other functions and areas of the website being faulty or inaccessible and, in the worst case, an emergency JavaScript development must be resorted to.
However, if JavaScript is used wisely and error-free, it can help to make the website perceived as modern, professional, lively and user-friendly. Many programmers try to achieve a more intuitive operation through the use of JavaScript in cooperation with web designers and techniques of user experience and user interface design, UI / UX design for short.
Advantages and disadvantages of JavaScript
Benefits | Minuses |
---|---|
Modern appearance | Sometimes seems overloaded (pop-ups, etc.) |
Dynamic elements and micro-animations | Additional potential sources of errors in web design |
More intuitive use | For security reasons, JavaScript is often disabled by users |
Prioritization of elements, cleaner and more minimalist appearance | There may be limitations to the function if JavaScript is disabled |
Direct database synchronization (e.g. when registering a user name or setting a password by asynchronous data transmission with Ajax | Should always be implemented in such a way that the page works even without JavaScript |
No additional load on the web server, because client-side | Depending on the performance of the executing computer and the bandwidth, little control over the final result on the part of the development |
Cheaper because of less server traffic | Additional load on the main memory of the executing computer |
Can automatically fix browser problems (e.g. in CSS layout) | The JavaScript code can be viewed by the end user at any time |
The advantages and disadvantages revolve mainly around two characteristics of JavaScript: that it is a form of client-side programming and has a great influence on the operation of the website. In principle, web development should be programmed in such a way that websites are fully functional even without activating JavaScript. The influence of JavaScript on usability is only positive if it does not create a risk in data security, there is no overloading of the website, no elements such as pop-ups or advertising disturb the users and, on the contrary, a shortening of click paths or another contribution to intuitive operation is made.
In the course of digitization, Internet connections and computers have become much faster and more powerful today than they were until a few years ago – and especially in the early days of JavaScript. Therefore, the disadvantages that relate to an overload of computing power or Internet connection are fortunately largely negligible.
The biggest advantage is the low server load. Without JavaScript, the entire page would have to be reloaded to view new content. This is achieved, for example, with the aforementioned Ajax (asynchronous JavaScript and XML), a concept for asynchronous data transmission with JavaScript. This makes it possible, among other things, to load content into a document only when users select or need it – for example, when clicking or hovering with the mouse over an element.
Extensions of JavaScript
As a manufacturer of hardware and software, Microsoft has developed its own scripting language: JScript is also a scripting language based on ECMAScript and with which additional features can be activated. However, Internet Explorer is so far the only browser that supports this language for websites, even if compatibility is constantly being expanded.
JavaScript in use at TenMedia in Berlin
Modern websites that reflect the state of the art not only through a clean and skilful web design, but also through performance, stability, complexity, usability and security have become rare nowadays. Although modern-looking websites can be developed by laymen quickly and without programming knowledge by low-threshold content management systems, these CMS often pose security risks. It is not uncommon for CMS such as TYPO3 or WordPress to be nothing more than a PHP and JavaScript code.
TenMedia is a web agency in Berlin and has set itself the task of implementing customer-specific web projects with individual software development, which exploit the possibilities of state-of-the-art technologies and develop powerful and secure web-based software solutions, progressive web apps and extensive web portals far away from turnkey CMS. We don’t have any off-the-shelf code: we combine JavaScript in the frontend with PHP programming and frameworks like Laravel to be able to create modular applications from scratch.
In our branch in Berlin between Alexanderplatz and Rosa-Luxemburg-Platz, our team is looking forward to any telephone, electronic or personal request.