Basic Web Design
 
Intermediate Web Design
 
Advanced Web Design
Web Design Program
 
Scripting Database
 
 
 
  Home
JavaScript
  Today's Date
  Dropdown Menu
  Mouse Over
  Status Bar
  Status Runner
  Background Color
  Script Tester
  Mini-Windows
  Cookies
  Expiration
Java Applets
Available CGI
META Tags
Server Elements

Popular Javascript Functions

   
  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.

About the language

JavaScript is a dynamically typed language. This means that data types in Javascript are not fixed but are automatically converted from one to other as required. For example, you could say myData = 10; in one line initializing the value of myData to an integer, and in the next line, say myData = "Hello World!" setting the value of myData to a string. Javascript will automatically convert data types within expressions if necessary. So if you say myData = "10" - 2;, you will end up with 8. Javascript automatically converts "10" to 10 and does the integer subtraction. If you are wondering why Javascript does not convert 2 to "2" instead, it is because the operator - is not defined for strings and hence "10" - "2" does not make any sense. This brings us to another interesting situation. The operator + is defined both for numbers and strings. So will 10 + "20" return 30 (10+20) or "1020" ("10" + "20"). It turns out that whenever you mix numbers and strings and use the + operator, Javascript will always convert everything to string before evaluating. Thus 10 + "20" is the same as "10" + "20" and will evaluate to "1020".

JavaScript is case sensitive. Thus 'example' is not the same as 'Example'.

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.

The examples collected are relevant scripts that can be used in every day web sites.  Each example is complete with code and a working demo.

 

 

 

 

 

 
Give us your Questions of Comments!!!