Javascript Tutorial Part-1  

Posted by Kunal Pradhan

Javascript is one the important part in making softwares,so in this ttopic I will teach it.

it is a scripting language designed to add interactivity to webpages and can be embedded directly into html pages.

How to find it???

It can be found as <> and via < language="javascript"> tag in body


How it is useful?

It is useful in make page extra ordinary.
but in our tutorials we will make the page automated using javascripts.

Lets make a simple script

basic : Declaring variables

What is variable?
a variable is like a 'container' for info u want to store.

we will store some values instead of biscuits

once you are declared variables,it can be used easily at any moment

javascript:var teacher="teaching you javascripts";alert(teacher);alert(teacher + "1");alert(teacher + "2")

run in above script i have declared teacher as a variable

declare variables code

var <>

e.g.
var tt
var ab

Give variable names as short as you can.
Keep them unique
Keep them clear,you should not confuse about them
like for sem marks give sm and final marks give fm


In above script
It will give alerts

alert()
function is used to popup a alert box.
like javascript:alert("this is an alert")

+ sign is used to join
It can join two variables
It can join variable with strings as we have done above
joined teacher variable with 1 and 2

We will talk about it later
now just concentrate on variables
make your own such scripts post it here

main use of variable we dont have to write a long things too many times as I did above
every time i have to write just variable teacher

instead of teacher i can give the variable name just t
so every time i have to write just t


javascript:var t="teaching you javascripts";alert(t);alert(t + "1");alert(t + "2")

tryout it yourself
Comment your created javascripts here

Read all javascript tutorials Click here

This entry was posted on Wednesday, June 18, 2008 and is filed under , . You can leave a response and follow any responses to this entry through the Subscribe to: Post Comments (Atom) .

0 comments