[ acky.net logo ]
Shells Starting at $4.99
Shells Starting at $4.99
Home > Tutorials > JavaScripts > Functions

JavaScript tutorial - Functions. by Alex Osipov

Page />
1 | 2 | 3

What is JavaScript?

JavaScript is a language which can help you accomplish things that you want to do quickly and without problems.JavaScript usually runs on the client side, meaning that the user's browser downloads the document and then processes the tags inside the document. If it finds any embedded JavaScript code it will try to interpret and run it.

Lately javascript has also been used on the server side for serving dynamic web pages and many other things. Making it a major contender to languages such as asp, php, and mod_perl.I am only going to be discussing the client side aspect of javascript in this tutorial, however the basic ideas of javascript are the same.

Getting Started:

Lets get started.The main thing that most people want to do with javascript is output things to the users based on their input.The first thing we need to do is create a document with a form which will take the user input but also embed the JS code into it.The example below will help you understand how javascript works, by including simple ideas and also bringing in more advanced ideas such as functions.

Example:


Product:
Quantity:


< View Code >

What this example does is displays a type of order form to the user, with 2 fields: the product and the quantity.When the user presses the submit button the javascript code is run and the "receipt" is printed on the same page.

Next Page >>

Email This Page To A Friend

Last updated: Monday, November 27, 2006 - 11:02 AM Eastern Daylight Time
Legal | Privacy Statement | Problems & Questions | Advertise | Link to us
© 1997-2007, All Rights Reserved.


Dedicated Server Provided by HighSpeedHosting