JavaScript Introduction

638 views

Published on

JavaScript First Step

Published in: Education
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
638
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
17
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

JavaScript Introduction

  1. 1. Java Script • Scripting Language • Dynamic Web pages requires User Inputs and structure webpage contents dynamically. • Its an Interpreted Programming Language • Its an Object Oriented Programming Language & Event Driven
  2. 2. Java Script • • • • • • Client Side & Server Side Creates Dynamic Webpages Netscape has introduced (Live Script) In 1995 SUN microsystems took over To be inserted into HTML page An Open & Cross platform application
  3. 3. Java Script • • • • Dynamic Text into HTM page Response to Events Read and Write HTML elements Validate Data
  4. 4. Java Script <html> <body> <script type="text/javascript"> document.write("Hello World!") </script> </body> </html> ;
  5. 5. Java Script <html> <body> <script type="text/javascript"> document.write(“<B> Hello World! <B>"); <!– this is comments for the javascript //--> // Single Line Comments /* Multi Line Comments ….*/ </script> </body> </html>
  6. 6. Java Script <html> <head> <script src="xxx.js"> </script> </head> <body> </body> </html>
  7. 7. Java Script Variables var x; var carname; var x=5; var carname="Volvo";
  8. 8. Java Script Expression Writing Y = X - 5; Z = Y + 5;
  9. 9. Java Script <html> <body> <script type="text/javascript"> x=5+5; document.write(x); document.write("<br />");
  10. 10. Java Script x="5"+"5"; document.write(x); document.write("<br />"); x=5+"5"; document.write(x); document.write("<br />");
  11. 11. Java Script x="5"+5; document.write(x); document.write("<br />"); </script> The common rule is: If you add a number and a string, the result will be a string.
  12. 12. Java Script • • • • • Arithmetic Operator Short hand Operator Comparison Operator Logical Operator Conditional (Ternary) Operator
  13. 13. Java Script • • • • Conditional Statements if statement if…else statement Nested if…else statements switch case statement

×