Learn JavaScript for free / PDF
Learn JavaScript for free / PDF
Table of Contents
Chapter 1 HTML Primer
Chapter 2 JavaScript Primer
Chapter 3 Alerts, Prompts, and User Feed back
Chapter 4 Im age Ef fects
Chapter 5 Back ground Ef fects
Chapter 6 The Doc u ment Ob ject Model
Chapter 7 Working with Date and Time
Chapter 8 Working with Cookies
Chapter 9 Working with the Sta tus Bar
Chapter 10 Cre ating Dy namic Menus
Chapter 11 Working with Forms
Chapter 12 Strings in JavaScript
Chapter 13 Math in JavaScript .
Chapter 14 Adding Plug-ins
Chapter 15 Ob jects in JavaScript .
Chapter 16 Tips and Tricks
Chapter 17 JavaScript Games
Chapter 18 ActiveX and JavaScript
Chapter 19 Pro gramming and JavaScript
Chapter 20 An tique Book store Pro ject .
-------------------------
Sample of the PDF document
This chapter will take you into the tech ni cal details of JavaScript. It is pos si ble to read the later chap ters and use them with out read ing this chap ter. How ever, at some point you will want to review this chap ter. Its con tents explain the intri ca cies of how JavaScript works. Even if you skip this chap ter, I rec om -
mend you come back to it when you have read the first 10 chap ters of the book.
Essential Tools
HTML files are plain text files. There fore, in order to add JavaScript to an exist ing HTML doc u ment, you need a text edi tor. Note pad is an excel lent choice for a sim ple text edi tor, if for no other rea son than it’s free with Windows. Most oper at ing sys tems includ ing Win dows, Macintosh, and Linux come
with a free text editor.
You can use var i ous edi tors for your JavaScript as well as your HTML. How - ever, many expe ri enced web devel op ers sim ply use a stan dard text edi tor that usu ally comes free with their oper at ing sys tem. If you are using Win dows, you already have Note pad and WordPad on your PC; those are both fine for doing HTML and JavaScript. The advan tage of using stan dard text edi tors is that they are free. The dis ad van tage is that they do not offer any debug ging tools to help you with the JavaScript. I per son ally pre fer sim ply using Note pad for my HTML and JavaScript development.
Choosing a Browser
Besides the basic pro gram ming tool, you need to be able to run your scripts and view their out put. It does n’t really mat ter which browser you choose. The lat est ver sions of Netscape and Microsoft Internet Explorer both fully support JavaScript. Com pat i bil ity should only be a seri ous prob lem with older ver sions of brows ers. Since both brows ers are avail able as a free down load, it is prob a - bly advis able that you down load a copy of both so that you can test your scripts in both.
Basic JavaScript Structure
In order to run cli ent-side JavaScript, you must embed the code in the HTML document. How ever, you can not place JavaScript state ments in the source code in just any loca tion. There are basi cally two meth ods to embed JavaScript scripts in HTML:
- As state ments and func tions using the tags.
- As short state ments resem bling URLs.
The
The . Every
state ment you put between the two tags will be inter preted as JavaScript code.
This is prob a bly the most com mon method for insert ing JavaScript into HTML
documents............
Learn JavaScript for free / PDF
0 commentaires: