Beginning JavaScript 4 th Edition
Chapter 1 Introduction to JavaScript and the Web
Chapter 1 Objectives What is JavaScript? What do you need in order to use JavaScript? What can JavaScript do for you?
What is JavaScript? A computer language: a series of instructions that tell the computer to do something
What is JavaScript? An interpreted language rather than a compiled language
What is JavaScript?
JavaScript is interpreted when the code is run. This interpretation has to be repeated every time the code is run.
What is JavaScript? JavaScript is not Java
What do you need? All you need to create and use JavaScript is: A text editor, such as Notepad A Web browser, such as Firefox (FF) or Internet Explorer (IE) to view your pages in
What can JavaScript do for you? Add interactivity to your Web pages Help you obtain information from visitors to your Web site Enable you to validate the information you receive
Adding JavaScript to your pages Insert JavaScript code in HTML/XHTML pages between an opening and closing script tag:
Adding JavaScript to your pages It’s good practice to include a type attribute in the opening script tag:
Adding JavaScript to your pages
Adding JavaScript to your pages document.bgColor="RED";
Adding JavaScript to your pages // script block 1 document.bgColor="RED";
Using JavaScript JavaScript enables you to make your Web pages