Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 270 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
270
Dung lượng
3,53 MB
Nội dung
[...]... Using Multiple scripts [JavaScript statements ] [JavaScript statements ] This is another script [JavaScript statements ] JavaScript Conventions There are several conventions used to make JavaScript code more understandable Some of these... to include simple JavaScripts and it is the method we will use for most of this book Here is the general syntax: [JavaScript Statements ] The tag acts like all other HTML tags Notice that it must be followed by its closing counterpart, Every statement you put between the two tags will be interpreted as JavaScript code This... charge Chapter 2 JavaScript Primer This book will teach you JavaScript by walking you step by step through the production of a complete web site However, to get a jump start it is essential that you first have a basic grasp of JavaScript The goal of this chapter is to introduce you to the basic concepts of JavaScript Each of the successive chapters discusses a particular facet of JavaScript with several... you JavaScript, the obvious question on your mind should be “How do I insert scripts into HTML?” Well, fortunately, that is not particularly difficult The browser deals with script code (including JavaScript) like it handles HTML code, scanning the source from left to right and from top to bottom JavaScript has “tags” of its own by which it instructs the browser and determines the layout However, JavaScript. .. have absolutely no prior knowledge of JavaScript A basic working knowledge of HTML is preferred but not essential The first two chapters provide a basic introduction on HTML and JavaScript The rest of the book takes you step by step through the process of building an actual web site using both HTML and JavaScript However, the main emphasis of this book is teaching you JavaScript After Chapter 1, “HTML... fully support JavaScript Compatibility should only be a serious problem with older versions of browsers Since both browsers are available as a free download, it is probably advisable that you download a copy of both so that you can test your scripts in both Basic JavaScript Structure In order to run client-side JavaScript, you must embed the code in the HTML document However, you cannot place JavaScript. .. will give you a good feel for the process of developing a commercial web site All the code for the finished web site can be downloaded from www .wordware. com /javascript Introduction n xv The Code The code for this book can be downloaded from www .wordware. com /javascript All the chapter examples are there ready to run Note that the numbered examples in the text correspond to the examples in the code files... tags will be interpreted as JavaScript code This is probably the most common method for inserting JavaScript into HTML documents JavaScript Primer n 15 The LANGUAGE attribute is used to specify the scripting language At present, the tag supports various languages including JavaScript and VBScript JavaScript is the default scripting language, so the LANGUAGE definition is not required However,... First Web Page I am learning HTML ! I LOVE HTML! You can email me at Email ME < Or go to this publisher's Web Site WordwarePublishing First... Figure 2-1 JavaScript Primer n 19 Chapter 2 Figure 2-1 This example is OK, but I personally prefer using JavaScript alert boxes So let us rewrite Example 2-1 using an alert box: Example 2-2 Hello Again! These two, very basic JavaScripts . class="bi x0 y0 w0 h0" alt="" Learn JavaScript Chuck Easttom Wordware Publishing, Inc. Library of Congress Cataloging-in-Publication Data Easttom, Chuck. Learn JavaScript / by Chuck Easttom. p 18 Fundamental JavaScript Concepts 20 Data Types and Variables in JavaScript 20 JavaScript Operators 22 JavaScript Statements 23 Multiple Statements 23 Nested Statements 24 JavaScript Expressions 24 JavaScript. 11 Chapter 2 JavaScript Primer 13 Essential Tools 13 Choosing a Browser 14 Basic JavaScript Structure 14 The <SCRIPT> Tag 14 Internal Scripts 14 External Scripts 15 Placing JavaScript Code 15 JavaScript