JavaScript<br />Why..What..How?<br />Mohammed Alhusban<br />
Introduction  (5 Mins)<br />Simple Program: Printing a Line of Text in a Web Page (10 Mins)<br />Prompt Dialogs: Obtaining...
Why JavaScript?<br />Enhances functionality and appearance of the web page.<br />Client-side scripting<br />Makes pages mo...
5 Websites That use JavaScript Animation Effectively!!<br />
What is JS? <br />JavaScript is a very popular scripting language on the internet.<br />Cross Platforms. JavaScript langua...
How..?<br />
Before going any further<br />One of the most important things to do when learning a new language is to master basic input...
Windows.alert (ex.2)</li></ul>input Methods<br /><ul><li>Using variable (ex.3)</li></li></ul><li>Code: Ex.1               ...
Code: Ex.1<br />html opening tag <br />
Code: Ex.1<br />html opening tag <br />Usually Java Scripts are included within the head tag, it also could be included in...
Code: Ex.1<br />html opening tag <br />Usually Java Scripts are included within the head tag, it also could be included in...
Code: Ex.1<br /><script> tag: Indicate that the text is part of a script<br />
Code: Ex.1<br />type attribute: <br />Specifies the type of file and the scripting language use.<br />
Code: Ex.1<br /><script> tag: Indicate that the text is part of a script<br />type attribute: <br />Specifies the type of ...
Code: Ex.1<br />A Method used to output a string onto the Browser <br />
Code: Ex.1<br />The string, that writeln method takes and printout on the browser.<br />Whatever between the quotations ma...
Execute Ex.1:         Output<br />Run<br />
Code: Ex.2<br />
Code: Ex.2<br />Popup windows<br />
Code: Ex.2<br />String will be printed out on the msg box or popup window<br />Popup window<br />
Execute Ex.2:             Output<br />
Execute Ex.2:<br />
JavaScript Data Types and Variables<br />Variable is a facility for storing data. The current value of the variable is the...
Code: Ex.3<br />
Code: Ex.3<br />Declaration of a variable <br />
Code: Ex.3<br />You can declare JavaScript variables with the <br />var statement<br />What? Huh<br />
Code: Ex.3<br />Initialization of the variable (name)<br />
Code: Ex.3<br />Prompt window prints out the string between quotations <br />
Code: Ex.3<br />writeln method prints the following in the browser:<br />string + value of the variable name + string <br ...
Run: Ex.3<br />
Next Lecture <br />Learning to Love JavaScript Prototypes<br />Thank you, I hope you have enjoyed this presentation <br />
Upcoming SlideShare
Loading in...5
×

Java Script

928
-1

Published on

Java Script programming fundamentals

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
928
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
53
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Java Script

  1. 1. JavaScript<br />Why..What..How?<br />Mohammed Alhusban<br />
  2. 2. Introduction (5 Mins)<br />Simple Program: Printing a Line of Text in a Web Page (10 Mins)<br />Prompt Dialogs: Obtaining User Input <br />Dynamic Welcome Page<br />Outline<br />Why & What <br />How<br />
  3. 3. Why JavaScript?<br />Enhances functionality and appearance of the web page.<br />Client-side scripting<br />Makes pages more dynamic and interactive<br />Easy-to-use<br />Built into web browsers and other applications<br />Offering functions such as <br />Form validation (JS can be used to validate data before it is submitted to a server. This saves the server from extra processing).<br />JavaScript can be used to set and retrieve web cookies (A JavaScript can be used to store and retrieve information on the visitor's computer).<br />Cool stuff like drop-down menus.<br />Hide and show elements.<br />Animation.<br />JS<br />
  4. 4. 5 Websites That use JavaScript Animation Effectively!!<br />
  5. 5. What is JS? <br />JavaScript is a very popular scripting language on the internet.<br />Cross Platforms. JavaScript language runs inmultiple environments and on many platforms.<br />JavaScript is usually embedded directly into HTML pages.<br />JavaScript is an interpreted language (means that scripts execute without preliminary compilation)<br /> Father of JS<br /> Brendan Eich<br />
  6. 6. How..?<br />
  7. 7. Before going any further<br />One of the most important things to do when learning a new language is to master basic input and output which is why Welcome to has become almost a cliché in programming textbooks.<br />Output Methods<br /><ul><li>document.writeln (ex.1)
  8. 8. Windows.alert (ex.2)</li></ul>input Methods<br /><ul><li>Using variable (ex.3)</li></li></ul><li>Code: Ex.1 (Output)<br />Java Script at the first sight.<br />
  9. 9. Code: Ex.1<br />html opening tag <br />
  10. 10. Code: Ex.1<br />html opening tag <br />Usually Java Scripts are included within the head tag, it also could be included in the body tag. <br />
  11. 11. Code: Ex.1<br />html opening tag <br />Usually Java Scripts are included within the head tag, it also could be included in the body tag. <br />One reason JavaScript is so popular is that it's relatively easy to add JavaScript to a web page<br />JavaScript<br />Code block<br />
  12. 12. Code: Ex.1<br /><script> tag: Indicate that the text is part of a script<br />
  13. 13. Code: Ex.1<br />type attribute: <br />Specifies the type of file and the scripting language use.<br />
  14. 14. Code: Ex.1<br /><script> tag: Indicate that the text is part of a script<br />type attribute: <br />Specifies the type of file and the scripting language use.<br /></script> End or Close Tag<br />
  15. 15. Code: Ex.1<br />A Method used to output a string onto the Browser <br />
  16. 16. Code: Ex.1<br />The string, that writeln method takes and printout on the browser.<br />Whatever between the quotations mark will be printed as is.<br />A Method used to output a string onto the Browser <br />
  17. 17. Execute Ex.1: Output<br />Run<br />
  18. 18. Code: Ex.2<br />
  19. 19. Code: Ex.2<br />Popup windows<br />
  20. 20. Code: Ex.2<br />String will be printed out on the msg box or popup window<br />Popup window<br />
  21. 21. Execute Ex.2: Output<br />
  22. 22. Execute Ex.2:<br />
  23. 23. JavaScript Data Types and Variables<br />Variable is a facility for storing data. The current value of the variable is the data actually stored in the variable.<br />Variable in JavaScript has name and value<br />Declare a variable  give it a name ( ex. var x )<br />Initialize a variable  give it a value ( ex. x = 100)<br />In order to use variable, they must be declared and initialized. <br />Variable types are not important in JavaScript. They may be interchanged as necessary. This means that if a variable is a string one minute, it can be an integer the next.<br />Declare  initialize  Call<br />
  24. 24. Code: Ex.3<br />
  25. 25. Code: Ex.3<br />Declaration of a variable <br />
  26. 26. Code: Ex.3<br />You can declare JavaScript variables with the <br />var statement<br />What? Huh<br />
  27. 27. Code: Ex.3<br />Initialization of the variable (name)<br />
  28. 28. Code: Ex.3<br />Prompt window prints out the string between quotations <br />
  29. 29. Code: Ex.3<br />writeln method prints the following in the browser:<br />string + value of the variable name + string <br />Hello + name value (input name) + Welcome to JavaScript Programming!<br />
  30. 30. Run: Ex.3<br />
  31. 31. Next Lecture <br />Learning to Love JavaScript Prototypes<br />Thank you, I hope you have enjoyed this presentation <br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×