Introduction to JavaScript Session 8
<ul><li>Explain Javasript language </li></ul><ul><li>Describe client-side and server-side Javascript </li></ul><ul><li>Des...
<ul><li>Javascript is a language that allows you build dynamic and interactive Web pages . </li></ul><ul><li>Javascript is...
Sripting <ul><li>Scripting refers to a series of commands that are interpreted and executed sequentially and immediately o...
Sripting <ul><li>Client side Scripting: Refer to a script being executed on the client’s machine by the browser. </li></ul...
<SCRIPT> Tag <ul><li>The <SCRIPT> tag defines a script for an HTML page to make them interactive </li></ul><ul><li>There a...
Declaring Variable <ul><li>In Javascript, the var keyword is used to create a variable by allocating memory to it.  </li><...
Rules <ul><li>Javascript is a case-sensitive language. </li></ul><ul><li>These rules are that a variable name: </li></ul><...
Data Types
Primary Data Types
Composite Data Types <ul><li>A composite data type stores a collection of multiple related values, unlike primitive  data ...
“ null “ Keyword <ul><li>The null keyword specifies that a variable does not hold any value. (the null value is not equal ...
Methods to display <ul><li>Javascript allows you to display information using the methods of the document object . </li></...
Comments  <ul><li>JavaScript  support two types of comments. There are: </li></ul><ul><li>Single - line comments </li></ul...
Esccap Sequences Character <ul><li>There are multiple escape sequence characters in Javascript that provides various kind ...
Built –in Function
JavaScript Keywords <ul><li>Keywords are predefined terms that can not be used as an object name, function name or variabl...
Build-in Functions Function Description Example toFixed Specifies the number of digits to be displayed after the decimal p...
Summary <ul><li>The Javascript runtime engine reads and executes the Javascript code either on the server or in the browse...
Summary… <ul><li>Javascript provides various keywords: break, if, continue, new, this… </li></ul><ul><li>The toFixed() fun...
Upcoming SlideShare
Loading in …5
×

08. session 08 intoduction to javascript

614 views
447 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
614
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

08. session 08 intoduction to javascript

  1. 1. Introduction to JavaScript Session 8
  2. 2. <ul><li>Explain Javasript language </li></ul><ul><li>Describe client-side and server-side Javascript </li></ul><ul><li>Describe build-in function </li></ul>Objectives
  3. 3. <ul><li>Javascript is a language that allows you build dynamic and interactive Web pages . </li></ul><ul><li>Javascript is a scripting language developed by Sun Microsystems and Netscape. </li></ul><ul><li>Javascript developed from Netscape’s Livescript </li></ul><ul><li>Client application run in a broswer such as Netscape Navigator or Internet Explorer and Firefox </li></ul>Introduction
  4. 4. Sripting <ul><li>Scripting refers to a series of commands that are interpreted and executed sequentially and immediately on an occurrence of an event </li></ul>
  5. 5. Sripting <ul><li>Client side Scripting: Refer to a script being executed on the client’s machine by the browser. </li></ul><ul><li>Server side Scripting: Refer to a script being executed on Web server to generate dynamic HTML pages . </li></ul>
  6. 6. <SCRIPT> Tag <ul><li>The <SCRIPT> tag defines a script for an HTML page to make them interactive </li></ul><ul><li>There are two main purpose of the <SCRIPT> tag, which are: </li></ul><ul><li>Identifies a given segment of script in the HTML page. </li></ul><ul><li>Load an external script file . </li></ul>
  7. 7. Declaring Variable <ul><li>In Javascript, the var keyword is used to create a variable by allocating memory to it. </li></ul>
  8. 8. Rules <ul><li>Javascript is a case-sensitive language. </li></ul><ul><li>These rules are that a variable name: </li></ul><ul><li>Can consist of digit, underscore, and alphabets. </li></ul><ul><li>Must begin with a letter or underscore character </li></ul><ul><li>Cannot begin with a number and cannot contain any punctuation marks. </li></ul><ul><li>Cannot contain any kind of special characters such as +,*,%,and so on. </li></ul><ul><li>Cannot contain spaces </li></ul><ul><li>Cannot be a Javascript keyword </li></ul>
  9. 9. Data Types
  10. 10. Primary Data Types
  11. 11. Composite Data Types <ul><li>A composite data type stores a collection of multiple related values, unlike primitive data types. </li></ul>
  12. 12. “ null “ Keyword <ul><li>The null keyword specifies that a variable does not hold any value. (the null value is not equal to zero because zero is a calculate value while null refers to the absence of a value) </li></ul>
  13. 13. Methods to display <ul><li>Javascript allows you to display information using the methods of the document object . </li></ul><ul><li>The document object is a predefined object in Javascript </li></ul><ul><li>write () : display any type of data </li></ul><ul><li>writeln(): Display any type of data and appends a new line character. </li></ul>
  14. 14. Comments <ul><li>JavaScript support two types of comments. There are: </li></ul><ul><li>Single - line comments </li></ul><ul><li>Multi - line comments </li></ul>
  15. 15. Esccap Sequences Character <ul><li>There are multiple escape sequence characters in Javascript that provides various kind of formatting. </li></ul>
  16. 16. Built –in Function
  17. 17. JavaScript Keywords <ul><li>Keywords are predefined terms that can not be used as an object name, function name or variable name </li></ul>JavaScript Keyword break case comment continue default delete do else export for function if import in Label new return switch this typeof var void while with
  18. 18. Build-in Functions Function Description Example toFixed Specifies the number of digits to be displayed after the decimal point var price = 23.456; var fixedprice = price.toFixed(2) return 23.46 toPrecision Specifies the number of digits to be displayed from a given number var price = 45.9431 alert(price. toPrecision(3)) return 45.9 toString Convert any value into a string value var age=25; alert(‘Age:’ + age.toString()+’years’) Return Age: 25 years
  19. 19. Summary <ul><li>The Javascript runtime engine reads and executes the Javascript code either on the server or in the browser. </li></ul><ul><li>The Server element includes JavaScript code, which is executed by the Web Server. </li></ul><ul><li>The NOSCRIPT element specifies the alternate content to be displayed, if the browser closes not support Javascript. </li></ul>
  20. 20. Summary… <ul><li>Javascript provides various keywords: break, if, continue, new, this… </li></ul><ul><li>The toFixed() function that specifies the number of digits to be displayed after the decimal point. </li></ul><ul><li>The toPrecision() function specifies the number of digits in a number to be displayed to the user. </li></ul><ul><li>The toString() function transforms a value into string. </li></ul>Building Dynamic Websites/Session 1/ of 16

×