Javascript2
-
Upload
program-in-interdisciplinary-computing -
Category
Technology
-
view
2.641 -
download
0
description
Transcript of Javascript2
![Page 1: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/1.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
![Page 2: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/2.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
What we’ve learned so far…
![Page 3: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/3.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Inserting script in html
Using functionsInserting comment in script
Selection with “If, else if”
Variable declaration &assignment
Strings & values
Concatenating strings& variablesOutput to Web page
Using Forms
Sending form data to function
Using arithmetic &comparison operators
![Page 4: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/4.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Switch instead of “if”
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/switch.html
![Page 5: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/5.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Looping
• Doing something over and over• Two kinds:
– for– while
![Page 6: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/6.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Iteration with “while”
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/while.html
![Page 7: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/7.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Iteration with “for”
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/for.html
![Page 8: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/8.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Working with Arrays
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/array.html
![Page 9: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/9.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Arrays – An Easier Way
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/array1.html
![Page 10: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/10.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Arrays – Even Easier
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/array2.html
![Page 11: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/11.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Arrays – Form Example
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/array3.html
![Page 12: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/12.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
Generating Random Numbers
http://pic.fsu.edu/courses/2011/spring/cgs2835/tutorials/javascript/examples/random.html
![Page 13: Javascript2](https://reader035.fdocuments.us/reader035/viewer/2022070303/54b4ca874a7959bd488b4634/html5/thumbnails/13.jpg)
C G S 2 8 3 5 Interdisciplinary Web Development
jQuery
• A library of Javascript functions to do common things that require a lot of programming
• http://www.w3schools.com/jquery/jquery_examples.asp