Web script, a computer programming language for adding dynamic capabilities to World Wide Web pages. Web pages marked up with HTML (hypertext markup language) or XML (extensible markup language) are largely static documents. Web scripting can add information to a page as a reader uses it or let the reader enter information that may, for example, be passed on to the order department of an online business. CGI (common gateway interface) provides one mechanism; it transmits requests and responses between the reader’s Web browser and the Web server that provides the page. The CGI component on the server contains small programs called scripts that take information from the browser system or provide it for display. A simple script might ask the reader’s name, determine the Internet address of the system that the reader uses, and print a greeting. Scripts may be written in any programming language, but, because they are generally simple text-processing routines, computer scripting languages such as PERL are particularly appropriate.

Another approach is to use a language designed for Web scripts to be executed by the browser. JavaScript is one such language, designed by the Netscape Communications Corp.; it may be used with both Netscape’s and Microsoft Corporation’s browsers. JavaScript is a simple language, quite different from Java. A JavaScript program may be embedded in a Web page with the HTML tag <script language=“JavaScript”>. JavaScript instructions following that tag will be executed by the browser when the page is selected. In order to speed up display of dynamic (interactive) pages, JavaScript is often combined with XML or some other language for exchanging information between the server and the client’s browser. In particular, the XMLHttpRequest command enables asynchronous data requests from the server without requiring the server to resend the entire Web page. This approach, or “philosophy,” of programming is called Ajax (asynchronous JavaScript and XML).

VB Script is a subset of Visual Basic. Originally developed for Microsoft’s Office suite of programs, it was later used for Web scripting as well. Its capabilities are similar to those of JavaScript, and it may be embedded in HTML in the same fashion.

computer chip. computer. Hand holding computer chip. Central processing unit (CPU). history and society, science and technology, microchip, microprocessor motherboard computer Circuit Board
Britannica Quiz
Computers and Technology Quiz

Behind the use of such scripting languages for Web programming lies the idea of component programming, in which programs are constructed by combining independent previously written components without any further language processing. JavaScript and VB Script programs were designed as components that may be attached to Web browsers to control how they display information.

David Hemmendinger

JavaScript, computer programming language that is a mainstay of web development, enabling the creation of complex features and interactivity in websites and web applications, as well as other use cases. JavaScript is a scripting language, meaning that its code is interpreted (i.e., translated into machine code) at runtime rather than when it is compiled by an application or engine.

JavaScript follows the ECMAScript standards set by Ecma International, an industry organization that has created technology standards since 1961. Despite this common standard, JavaScript implementation varies between Internet browsers because of the different engines they use to interpret and execute JavaScript code. The Oracle Corporation owns the trademark on the term “JavaScript,” but this is in reference to the Java language, rather than JavaScript specifically.

JavaScript is one of three core languages, along with HTML and CSS, used to design websites. HTML provides a website with its structure and hierarchy and enables its content to be rendered correctly, and CSS controls the stylistic presentation of the website’s content (elements such as color, layout, and responsiveness). JavaScript allows websites to be rendered dynamically and interact with users’ actions. JavaScript code alters HTML and CSS code to make a website interactive rather than a static page. For instance, JavaScript enables features such as a pull-down menu, embedded media files, and form validation. JavaScript also allows a user to access some of the site’s content by selecting filtering criteria (for example, selecting a genre or a director to filter content on a movie streaming site).

JavaScript is primarily a client-side scripting language, meaning that its code is read and executed by a web browser, such as Google Chrome or Firefox, rather than by a server. The language has become truly ubiquitous, with more than 98 percent of websites reported to have been using JavaScript in 2022. But while client-side scripting (and website interactivity) remains a crucial use of JavaScript, it has evolved beyond the browser. Since the 2009 release of Node.js, an open-source server environment, JavaScript has become a popular server-side scripting language, enabling it to run not just in a browser but also on a server. This opened many new applications for JavaScript, from running the database that powers the back-end of a website to creating full-fledged desktop applications. JavaScript has become an important technology in mobile development, games development, the programming of Internet of things devices, and serverless computing architecture.

The introduction of JavaScript web frameworks, such as AngularJS and REACT.js, also contributed to its popularity and reach. Such frameworks simplify the process of creating responsive web applications and websites and improve their efficiency. For example, REACT.js, one of the most popular front-end frameworks, allows websites and web applications to dynamically load required content rather than reloading the entire code after each user interaction. This approach also speeds up development, as this code can be reused in different part of the site or even reused to develop a whole new website or application.

André Munro