Chapter 2WP
Chapter 2WP
UNIT 1
• JavaScript (js) is a light-weight object-oriented programming language
which is used by several websites for scripting the webpages.
• It is an interpreted, full-fledged programming language that enables
dynamic interactivity on websites when applied to an HTML
document.
• The JavaScript Translator (embedded in the browser) is responsible
for translating the JavaScript code for the web browser.
• It turns static HTML web pages into interactive web pages by
dynamically updating content, validating form data, controlling
multimedia, animate images etc
• It is a case-sensitive language.
• JavaScript History
• In early 1995, Brendan Eich from Netscape designed and implemented
a new language for non-java programmers to give newly added Java
support in Netscape navigator.
• It was initially named Mocha, then LiveScript, and finally JavaScript.
• Application of JavaScript
• JavaScript is used to create interactive websites. It is mainly used for:
• Client-side validation,
• Dynamic drop-down menus,
• Displaying date and time,
• Displaying pop-up windows and dialog boxes (like an alert dialog box,
confirm dialog box and prompt dialog box),
• Setup JavaScript Development Environment
• Here, we are going to use JavaScript in developing a web application.
So, we must have at least two things, a browser, and an editor to write
the JavaScript code.
• The followings are some of the well-known JavaScript editors:
• Visual Studio Code (Free, cross-platform)
• Eclipse (Free, cross-platform)
• Atom (Free, cross-platform)
• Notepad++ (Free, Windows)
• Code Lobster (Free, cross-platform)
• WebStorm (Paid, cross-platform)
• Online Editors for JavaScript
• Use the online editor to quickly execute the JavaScript code without
any installation. The followings are free online editors:
• jsfiddle.net
• jsbin.com
• playcode.io
• Browser Object Model (BOM)
• The Browser Object Model (BOM) is used to interact with the
browser.
• The default object of browser is window means you can call all the
functions of window by specifying window or directly. For example:
Window Object