Favorites
Introduction to JavaScript

Introduction to JavaScript

JavaScript is a compact, object-based scripting language for developing client and server Internet applications.

  1. JavaScript functions can be embedded directly in the HTML code and should be placed in the head of the HTML document

  2. To use JavaScript functions the code needs to follow the line: <SCRIPT LANGUAGE="JavaScript"> and preceed </SCRIPT>

  3. and bracketed by <!-- and -->

  4. JavaScript is case sensitive and uses new lines to terminate a line of code; semicolons can be used to separate lines of code on a line

  5. JavaScript uses both // and /* */ to indicate comments

  6. JavaScript supports data types: numeric, string, Boolean, and null

  7. JavaScript supports operators: +, -, *, /, %, ++, --, =, +=, -=, *=, /=, %=, &&, ||, !, &, |, ^

  8. JavaScript uses the control structures: if (else), for, while, and for...in

  9. JavaScript contains three user interfaces: alert(message), prompt(message, [Default]), confirm(message)

  10. JavaScript does not have built-in support for arrays, but does allow for building of arrays

  11. JavaScript supports four built-in objects:

    • Window

      • Properties: name, parent, self, top, defaultstatus, status, script, location, frame, history, navigator, document

      • Methods: Alert, Confirm, Prompt, Open, Close, SetTimeout, ClearTimeout, Navigate

      • Events: Onload, Unload

    • String

    • Math

    • Date

 

Books

JavaScript for Dummies by Emily A. Vander Veer. 2nd Edition. IDG Books. ISBN 0-7645-0223-9
Comments: This book is a good introduction for anyone wanting to learn the basics of JavaScript programming. Don't expect to find lots of exotic scripts here. This book is a good place to start if you want to learn how to write your own scripts.

JavaScript Unleashed Second Edition by Richard Wagner, et. al. Sams.net Publishing. ISBN 1-57521-306-0
Comments: An excellent book for learning the basics and some more advanced techniques. A very good resource.

Guide to Building Intelligent Websites with JavaScript by Nigel Ford. Wiley Computer Publishing. ISBN 0-471-24274-8
Comments: This book doesn't spend much time on the fundamentals of JS programming. Instead it has lots of script examples. It teaches by example. Some of the scripts have educational value.