Your SlideShare is downloading. ×
0
JavaScriptTuesday, April 16, 13
The Script Tag                   <script>                       alert("My First JavaScript");                   </script>T...
JavaScript LanguageTuesday, April 16, 13
JavaScript Statements      JavaScript statements are "commands" to the browser. The purpose      of the statements is to t...
Semicolon ;     Semicolon separates JavaScript statements.     You add a semicolon at the end of each executable statement...
JavaScript Code      JavaScript code (or just JavaScript) is a sequence of JavaScript      statements. Each statement is e...
JavaScript Functions      The purpose of a function is to make the sequence of statements      execute together when calle...
JavaScript is Case Sensitive      Watch your capitalization closely when you write JavaScript      statements:      A func...
JavaScript Comments      Comments will not be executed by JavaScript.      Comments can be added to explain the JavaScript...
JavaScript Comments      In the following example the comment is used to prevent the      execution of one of the codeline...
JavaScript Functions w/Arguments      When you call a function, you can pass along some values to it, these values      ar...
jQuery                        docs.jquery.comTuesday, April 16, 13
jQuery      jQuery commands with a call to the jQuery function. Here is how a jQuery      statement is constructed.       ...
jQuery selectors      Same as CSS. Tags, Classes and IDs      jQuery(‘p’).css(‘color’, ‘blue’);      jQuery(‘.classname’)....
Upcoming SlideShare
Loading in...5
×

Introduction to JavaScript

618

Published on

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

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

No notes for slide

Transcript of "Introduction to JavaScript"

  1. 1. JavaScriptTuesday, April 16, 13
  2. 2. The Script Tag <script> alert("My First JavaScript"); </script>Tuesday, April 16, 13
  3. 3. JavaScript LanguageTuesday, April 16, 13
  4. 4. JavaScript Statements JavaScript statements are "commands" to the browser. The purpose of the statements is to tell the browser what to do. <script> document.getElementById("demo").innerHTML="Hello"; </script>Tuesday, April 16, 13
  5. 5. Semicolon ; Semicolon separates JavaScript statements. You add a semicolon at the end of each executable statement. <script> document.getElementById("demo").innerHTML="Hello"; </script>Tuesday, April 16, 13
  6. 6. JavaScript Code JavaScript code (or just JavaScript) is a sequence of JavaScript statements. Each statement is executed by the browser in the sequence they are written. <script> document.getElementById("demo").innerHTML="Hello"; document.getElementById("myDIV").innerHTML="Hi"; </script>Tuesday, April 16, 13
  7. 7. JavaScript Functions The purpose of a function is to make the sequence of statements execute together when called <script> function myFunction() { document.getElementById("demo").innerHTML="Hello"; document.getElementById("myDIV").innerHTML="Hi"; } </script>Tuesday, April 16, 13
  8. 8. JavaScript is Case Sensitive Watch your capitalization closely when you write JavaScript statements: A function getElementById is not the same as getElementbyID. <script> function myFunction() { document.getElementById("demo").innerHTML="Hello"; document.getElementbyId("demo").innerHTML="Hello"; } </script>Tuesday, April 16, 13
  9. 9. JavaScript Comments Comments will not be executed by JavaScript. Comments can be added to explain the JavaScript, or to make the code more readable. Single line comments start with //. <script> function myFunction() { // Write to a heading document.getElementById("demo").innerHTML="Hello"; } </script>Tuesday, April 16, 13
  10. 10. JavaScript Comments In the following example the comment is used to prevent the execution of one of the codelines (can be suitable for debugging): <script> function myFunction() { // document.getElementById("demo").innerHTML="Hello"; } </script>Tuesday, April 16, 13
  11. 11. JavaScript Functions w/Arguments When you call a function, you can pass along some values to it, these values are called arguments or parameters. These arguments can be used inside the function. You can send as many arguments as you like, separated by commas (,) <script> function myFunction(parameter1, parameter2) { document.getElementById("demo").innerHTML= parameter1; document.getElementById("myDIV").innerHTML= parameter2; } </script>Tuesday, April 16, 13
  12. 12. jQuery docs.jquery.comTuesday, April 16, 13
  13. 13. jQuery jQuery commands with a call to the jQuery function. Here is how a jQuery statement is constructed. jQuery(‘p’).css(‘color’, ‘blue’); selector action parameters jQuery(‘p’) .css (‘color’, ‘blue’)Tuesday, April 16, 13
  14. 14. jQuery selectors Same as CSS. Tags, Classes and IDs jQuery(‘p’).css(‘color’, ‘blue’); jQuery(‘.classname’).css(‘color’, ‘blue’); jQuery(‘#idname’).css(‘color’, ‘blue’);Tuesday, April 16, 13
  1. A particular slide catching your eye?

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

×