JavaScript : Introduction




JavaScript : Introduction 

JavaScript : Introduction






Sample of the pdf document 





Introduction

JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari.

In this lecture we will Introduce JavaScript programming and present examples that illustrate several important features of JavaScript. Each example is carefully analyzed one line at a time

What is JavaScript?
• JavaScript was designed to add interactivity to HTML pages
• JavaScript is a scripting language
• A scripting language is a lightweight programming language
• JavaScript is usually embedded directly into HTML pages
• JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
• Everyone can use JavaScript without purchasing a license


The first sample

We begin by considering a simple script (or program) that displays the text “Welcome to JavaScript Programming!” in the body of an XHTML document. The Internet Explorer Web browser contains a JavaScript interpreter, which processes the commands written in Java-
Script. The JavaScript code and its output are shown in Fig. 3-1.
1
2 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
45

6
78

9
10 A First Program in JavaScript
11
12
17
-->
18
19 20


Alert message in JavaScript

Line 13 in the script uses the browser’s window object to display an alert dialog. The argument to the window object’s alert method is the
string to display. Executing the preceding statement displays the dialog shown in the first window of Fig. 7.4. The title bar of the dialog contains the string Microsoft Internet Explorer, to indicate that the browser is presenting
a message to the user. The dialog provides an OK button that allows the user to dismiss (i.e., hide) the dialog by clicking the button. To dismiss the dialog position the mouse cursor (also called the mouse pointer) over the OK button and click the mouse.




Download JavaScript : Introduction

JavaScript : Introduction 



0 commentaires: