CSIS 138 Javascript Class1

  • 1,247 views
Uploaded on

Instructor Teresa Pelkie at Palomar College - Introduction to JavaScript

Instructor Teresa Pelkie at Palomar College - Introduction to JavaScript

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,247
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
68
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • The JavaScript Language consists of objects CSIS 138 Instructor Teresa Pelkie

Transcript

  • 1. JavaScript – Class 1 Overview of the Basics
    • Objects
      • Properties
      • Methods
      • Events
  • 2. JavaScript Syntax
    • document.bgColor = “red”;
    • document.write( );
    • // change color to red
    • /* change color to red
    • and write to the page
    • */
  • 3. JavaScript Objects
    • Built in JavaScript Objects
      • Navigator Object
      • Date Object
      • Math Object
      • String Object
      • Array Object
  • 4. JavaScript Objects
    • Browser Objects
  • 5. Where is JavaScript code placed?
    • <head>
    • <script type=”text/JavaScript” language=&quot;JavaScript&quot;>  <!- -
    • statements go here ; //-->
    • </script>
    • </head>
  • 6. Where is JavaScript code placed?
    • <head>
    • <script type=”text/JavaScript”> 
    • statements go here ;
    • </script>
    • </head>
  • 7. Where is JavaScript code placed?
    • <head>
    • <script type=”text/JavaScript” src=”file.js”>
    • </script>
    • </head>
  • 8. Where is JavaScript code placed?
    • <head>
    • <script type=”text/JavaScript”>  statements go here ;
    • </script>
    • <script type=”text/JavaScript” src=”file.js”>
    • </script>
    • </head>
  • 9. Where is JavaScript code placed?
    • <body>
    • <a href=&quot;#&quot; onmouseover=“showPic();&quot;>click</a>
    • <a href=”javascript:openWin();”>click</a>
    • </body>
  • 10. <noscript> You need JavaScript to see this page! </noscript>
  • 11. Data and Types
    • Information that we process and display
    • Can be in many forms or types
      • Numeric
      • String
      • Boolean
  • 12. Variables
    • Hold information or data
    • Can hold these types of data
      • Numeric
      • String
      • Boolean
  • 13. How we create or declare a variable
    • var myName;
  • 14. Initializing a variable
    • var myName;
    • myName = “Teresa”;
    • _______________________
    • var myName = “Teresa”;
  • 15. Initializing a variable
    • var myAge;
    • myAge = 21;
    • _______________________
    • var zipCode;
    • zipCode = “92082”;
  • 16. The alert() method alert(); window.alert();
  • 17. The alert() method <head> <script language=&quot;JavaScript&quot;> alert (&quot;This is an alert()&quot;); </script> </head>
  • 18. The alert() method
  • 19. The alert() method <script language=”JavaScript”> var myFirstVariable; myFirstVariable = “Hello!”; alert(myFirstVariable); </script>
  • 20. The alert() method
  • 21. The write() method <body> <script language=”JavaScript”> document.write (&quot;Hello World&quot;); </script> </body>
  • 22. The write() method
  • 23. The write() method <body> <script language=”JavaScript”> document.write (‘Hello “Big” World’); </script> </body>
  • 24. The write() method
  • 25. The write() method <script language=&quot;JavaScript&quot;> var firstVar; var secondVar firstVar = &quot;Hello&quot;; secondVar = &quot;World!&quot;; document.write( firstVar + “ “ + secondVar ); </script>
  • 26. The write() method
  • 27. The write() method <script language=&quot;JavaScript&quot;> var first; var last; first = “Teresa&quot;; last = “Pelkie&quot;; document.write(“<b>Hello “ + first + “ “ + last + “</b>”); </script>
  • 28. The write() method
  • 29.
    • JavaScript – Class 1
    • Assignment 1