The JavaScript tutorial is aimed primarily at those who have had at least some exposure to another programming language (C or Visual Basic is sufficient to understanding JavaScript). JavaScript is a basic language which conforms tightly to the core concepts of computer programming.
This webpage cover the basic concepts and illustrate the syntax and methodology of JavaScript.
Here are some of available books on JavaScript.

Beginning Javascript

Javascript : The Definitive Guide (3rd Edition)

Javascript Bible, 4th Edition

This tutorial will take you step by step through the fundamentals of JavaScript. You will learn how to write functions, use data from text boxes , create if-then conditionals, program loops etc. JavaScript is an easy-to-use programming language that can be embedded in the header of web pages. It can enhance the dynamics and interactive features of page by allowing you to perform calculations, check forms, write interactive games, add special effects, customize graphics selections, create security passwords and more. JavaScript is not Java. Actually, the two languages have almost nothing in common except for the name. JavaScript is much simpler to use than Java. Everyone that wants to program JavaScript should know what is OOP (Object Oriented Programming). OOP is a programming technique designed to simplify complicated programming concepts. Object-oriented programming consists of Objects, Methods and Properties.

Your web page document is an object. Any table, form, button, image, or link on your page is also an object. Each object has certain properties. For example, the background color of your document is written document.bgcolor. You would change the color of your page to red by writing the line: document.bgcolor="red".

Most objects have a certain collection of things that they can do. A new document is opened with the method You can write "Hello World" into a document by typing document.write("Hello World"). Open() and write() are both methods of the object: document. Events are how we trigger our functions to run. The easisest example is a button, whose definition includes the words onClick="run_my_function()". The onClick event, as its name implies, will run the function when the user clicks on the button. Other events include OnMouseOver, OnMouseOut, OnMouseOut, OnFocus, OnBlur, OnLoad and OnUnload. JavaScript usually goes between the tag and the tag. Like HTML, JavaScript is just text that can be typed into a word processor. It goes right into the HTML that describes your page. The beginning of JavaScript begins with script language="JavaScript". Actually, we don't need to write this because JavaScript is the default script language for all browsers. However, this could change, so it's a good idea to include the language element. Everything between // and the end of a line is a comment and will be ignored.

This is a very simple script.
It opens up an alert message box which displays whatever is typed in the form box below.

Here is another example with 4 buttons. Clicking on button you change the background of the document.

When you need to do something, like open a window, write text to the screen, get the sin of a number, send the user back to the previous page, or display an alert box you are using a METHOD. When you change the details about something which already exists, you are changing its PROPERTIES.

Here are a few types of commands that metods are useful for.

JavaScript supports a compact set of statements that you can use to incorporate a great deal of interactivity in Web pages.

Use the semicolon (;) character to separate statements in JavaScript code.

A conditional statement is a set of commands that executes if a specified condition is true. JavaScript supports two conditional statements: if...else and switch.
if...else Statement
Use the if statement to perform certain statements if a logical condition is true; use the optional else clause to perform other statements if the condition is false. An if statement looks as follows:

if (condition) {
[else {
} ]
The condition can be any JavaScript expression that evaluates to true or false. The statements to be executed can be any JavaScript statements, including further nested if statements. If you want to use more than one statement after an if or else statement, you must enclose the statements in curly braces, {}.

Do not confuse the primitive Boolean values true and false with the true and false values of the Boolean object. Any object whose value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. For example:
var b = new Boolean(false);
if (b) // this condition evaluates to true

SWITCH Statement
A switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case label. If a match is found, the program executes the associated statement. A switch statement looks as follows:
switch (expression){
case label :
case label :
default : statement;
The program first looks for a label matching the value of expression and then executes the associated statement. If no matching label is found, the program looks for the optional default statement, and if found, executes the associated statement. If no default statement is found, the program continues execution at the statement following the end of switch.
The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. If break is omitted, the program continues execution at the next statement in the switch statement.

LOOP Statements
A loop is a set of commands that executes repeatedly until a specified condition is met. JavaScript supports the for, do while, while, and label loop statements (label is not itself a looping statement, but is frequently used with these statements). In addition, you can use the break and continue statements within loop statements.

FOR Statement
A for loop repeats until a specified condition evaluates to false. The JavaScript for loop is similar to the Java and C for loop. A for statement looks as follows:
for ([initialExpression]; [condition]; [incrementExpression]) { statements
When a for loop executes, the following occurs:
1.The initializing expression initial-expression, if any, is executed. This expression usually initializes one or more loop counters, but the syntax allows an expression of any degree of complexity.
2.The condition expression is evaluated. If the value of condition is true, the loop statements execute. If the value of condition is false, the for loop terminates.
3.The statements execute.
4.The update expression incrementExpression executes, and control returns to Step 2.

DO...WHILE Statement
The do...while statement repeats until a specified condition evaluates to false. A do...while statement looks as follows:
do {
} while (condition)
statement executes once before the condition is checked. If condition returns true, the statement executes again. At the end of every execution, the condition is checked. When the condition returns false, execution stops and control passes to the statement following do...while. Example. In the following example, the do loop iterates at least once and reiterates until i is no longer less than 5.
do {
} while (i<5);

WHILE Statement
A while statement executes its statements as long as a specified condition evaluates to true. A while statement looks as follows:
while (condition) {
If the condition becomes false, the statements within the loop stop executing and control passes to the statement following the loop. The condition test occurs before the statements in the loop are executed. If the condition returns true, the statements are executed and the condition is tested again. If the condition returns false, execution stops and control is passed to the statement following while.
Example 1. The following while loop iterates as long as n is less than three:
n = 0
x = 0
while( n < 3 ) {
n ++
x += n
With each iteration, the loop increments n and adds that value to x. Therefore, x and n take on the following values:
After the first pass: n = 1 and x = 1
After the second pass: n = 2 and x = 3
After the third pass: n = 3 and x = 6
After completing the third pass, the condition n < 3 is no longer true, so the loop terminates.
Example 2: infinite loop. Make sure the condition in a loop eventually becomes false; otherwise, the loop will never terminate. The statements in the following while loop execute forever because the condition never becomes false:
while (true) {
alert("Hello, world") }

LABEL Statement
A label provides a statement with an identifier that lets you refer to it elsewhere in your program. For example, you can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. The syntax of the label statement looks like the following:
label : statement
The value of label may be any JavaScript identifier that is not a reserved word. The statement that you identify with a label may be any type.
Example. In this example, the label markLoop identifies a while loop.
markLoop: while (theMark == true) doSomething(); }

BREAK Statement
Use the break statement to terminate a loop, switch, or label statement.
When you use break with a while, do-while, for, or switch statement, break terminates the innermost enclosing loop or switch immediately and transfers control to the following statement.
When you use break within an enclosing label statement, it terminates the statement and transfers control to the following statement. If you specify a label when you issue the break, the break statement terminates the specified statement.
The syntax of the break statement looks like the following:
1. break
2. break [label]
The first form of the syntax terminates the innermost enclosing loop, switch, or label; the second form of the syntax terminates the specified enclosing label statement.
Example. The following example iterates through the elements in an array until it finds the index of an element whose value is theValue:
for (i = 0; i < a.length; i++) {
if (a[i] = theValue);

CONTINUE Statement
The continue statement can be used to restart a while, do-while, for, or label statement. In a while or for statement, continue terminates the current loop and continues execution of the loop with the next iteration. In contrast to the break statement, continue does not terminate the execution of the loop entirely. In a while loop, it jumps back to the condition. In a for loop, it jumps to the increment-expression. In a label statement, continue is followed by a label that identifies a label statement. This type of continue restarts a label statement or continues execution of a labelled loop with the next iteration. continue must be in a looping statement identified by the label used by continue.
The syntax of the continue statement looks like the following:
1. continue 2. continue [label]

JavaScript uses the and with statements to manipulate objects.

FOR...IN Statement

The statement iterates a specified variable over all the properties of an object. For each distinct property, JavaScript executes the specified statements. A statement looks as follows:
for (variable in object) { statements }

WITH Statement
The with statement establishes the default object for a set of statements. JavaScript looks up any unqualified names within the set of statements to determine if the names are properties of the default object. If an unqualified name matches a property, then the property is used in the statement; otherwise, a local or global variable is used. A with statement looks as follows: with (object){ statements }

Comments are author notations that explain what a script does. Comments are ignored by the interpreter.
JavaScript supports Java-style comments:
Comments on a single line are preceded by a double-slash (//).
Comments that span multiple lines are preceded by /* and followed by */: Example. The following example shows two comments: // This is a single-line comment. /* This is a multiple-line comment. It can be of any length, and you can put whatever you want here. */

There are 3 events which are very useful when working in a form: FOCUS means the object where the cursor is currently blinking. OnFocus events occur whenever the cursor enters that textbox or textarea.
BLUR is the opposite of focus. Therefore an onBlur event will occur whenever a text object loses focus.

We can attached hardware to the computer and we were able to access the hardware directly. For more details see following links:
Data Acquisition From Web Browser.
ML Electronics, electronics and software design (JavaScript, VB, C)
Embedded Internet. OMEGA iSeries Meter and Controllers - Direct Connection to Ethernet.

As mentioned this is a brief tutorial on JavaScript technology. For additional information see these web sites:
XML Software Guide
JavaScript Guide