Tuesday, October 20, 2009

What Does JavaScript Do?

What Does JavaScript Do?
By Jason Isbell
eHow Contributing Writer
JavaScript is a client-side scripting language that is embedded in web pages. JavaScript allows for dynamic content than static HTML.
1. As a client-side language, JavaScript is downloaded to the browser, and the browser interprets the code. This reduces load on the server and allows changes, using Ajax, as you use the web page.
Embedding
2. Because JavaScript is embedded in HTML, it needs a web browser to be able to use it. It cannot be compiled like some other languages, such as C or Basic.
Dynamic Content
3. JavaScript can have variables that make the content more dynamic. It can display the current date and time, rotate a picture or change the CSS style of a form to make it stand out when you make an error. Ajax is using JavaScript and CSS together in an HTML page to do dynamic changes.
Speed
4. Because JavaScript is compiled on your computer, the speed it runs depends on your computer. JavaScript has lower overhead than Java, C# or Flash, so for the functions JavaScript can do, such as rotating images, it is often better to use JavaScript and keep the demands of your computer minimal.
Limitations
5. While there are many reasons to use JavaScript, it also has limitations. Because it is client side, interactions with a server using JavaScript is difficult and in some cases not possible. It is normal practice to post a form to a PHP script for database and server-side routines. JavaScript can also be turned off by the client, rendering your script useless. The same can be said for Java, Flash and many other languages