I propose to consider the question: Can machines think?.” Alan Turing
A resource for web developers a code snippet library with step by step tutorials.

a niche content web resource for geeks

       

Search Amazon

JavaScript: Intro - an introduction to JavaScript


This page will give you an initial overview of what JavaScript is and some of its uses.


Or you can skip this Intro and go straight to the code examples on the JavaScript: Basics page.


JavaScript is a client-side scripting lauguage. Because JavaScript runs client-side it can help to reduce the workload on the server. It can also reduce the number of journeys required from the client to the server and back again. This can speed up user interaction and feedback times.


JavaScript is embedded into XHTMLExtensible Hypertext Markup Language or HTMLHypertext Markup Language and allows website developers to write web pages incorporating JavaScript quickly.


JavaScript is a great way to dive into the programming environment with the minimum of software requirements. All you need is a text editor and a browser.


JavaScript is not Java. Java is translated first before it reaches the browser. JavaScript is interpreted line by line by the browser.


JavaScript can respond to user input and create an interactive interface for the user. JavaScript can catch events that occur on the page and react to them, for example: when a button is clicked.


JavaScript has access to the Document Object Model (DOM) and can therefore control XHTML objects such as forms, to provide fast and intuitive form validation for example.


JavaScript can create and has access to cookies, thereby giving it the ability to store information from page to page, circumventing the connectionless environment of the web.


JavaScript has cross-browser support.


Remember however:


A visitor to your website may have JavaScript turned off.


Not all browsers implement JavaScript in the same way.


How to use the JavaScript scripts found on this website.


You can paste the JavaScript scripts in the <head></head> or <body></body> section of the web page. Remembering that JavaScript is run line by line: so you can't call a function before the browser knows that it exists. Scripts that write to the page are best placed in the <body></body> section.


The scripts must be between <script></script> tags.


You can place all your functions together in a function library, which is just a file with a .js file extension. You will not need any XHTML or <script></script> tags in the function library file, just the functions themselves, but the web pages requiring them must reference that file.


JavaScript is case sensitive and the semi-colon ';' is not strictly required, unless you wish to place more than one statement on a line.

 

These rules in action are described with code examples in JavaScript: Basics.



 

Bookmark and Share

 

Copyright © 2006-2010 justfigures.co.uk