Basics

Scripts

JS Links































The HTML Writers Guild


Email Sunshine


The JavaScript Language

JavaScript is a scripting language which is similar in syntax to Java. The JavaScript code is embedded within the HTML file and is interpreted by the client browser. JavaScript brings interaction to the web pages. Using JavaScript, it is possible to customize HTML documents on the fly, write event handlers for elements on a page, validate data at the client side and perform other client-side computations.

To view the various JavaScript examples, you need a JavaScript capable browser. . If any of examples are not working properly, please Email me.

JavaScript is a loosely typed language. You can use variables without declaring them first and freely convert between different types. Thus, the two expressions

	x = 10 + "20"
	    and
	x = "10" + 20
		
are both valid in JavaScript. However in the first case, the value of x will be 30 whereas in the second case it will be "1020". This is because the data type of the result of an expression is the same as that of the left most element in the expression.

JavaScript is case sensitive. Thus foo is not the same as Foo.(Does anyone know what foo actually means?)

Due to the security built into JavaScript, it is highly unlikely that JavaScript code can do damage on your system. So you can run them without worry. JavaScript Examples:
The examples provided are simple. If you find any of them useful, feel free to copy to your page.


Back to Scripts Contents