SlideShare a Scribd company logo
Introduction to JavaScript Session 8
Explain Javasript language Describe client-side and server-side Javascript Describe build-in function Objectives
Javascript is a language that allows you build dynamic and interactive Web pages . Javascript is a scripting language developed by Sun Microsystems and Netscape. Javascript developed from Netscape’s Livescript Client application run in a broswer such as Netscape  Navigator or Internet Explorer and Firefox Introduction
Sripting Scripting refers to a series of commands that are interpreted and executed sequentially and immediately on an occurrence of an event
Sripting Client side Scripting: Refer to a script being executed on the client’s machine by the browser. Server side Scripting: Refer to a script being executed on Web server to generate dynamic HTML pages .
<SCRIPT> Tag The <SCRIPT> tag defines a script for an HTML page to make them interactive There are two main purpose of the <SCRIPT> tag, which are: Identifies a given segment of script in the HTML page. Load an external script file .
Declaring Variable In Javascript, the var keyword is used to create a variable by allocating memory to it.
Rules Javascript is a case-sensitive language. These rules are that a variable name: Can consist of digit, underscore, and alphabets. Must begin with a letter or underscore character Cannot begin with a number and cannot contain any punctuation marks. Cannot contain any kind of special characters such as +,*,%,and so on. Cannot contain spaces Cannot be  a Javascript keyword
Data Types
Primary Data Types
Composite Data Types A composite data type stores a collection of multiple related values, unlike primitive  data types.
“ null “ Keyword 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)
Methods to display Javascript allows you to display information using the methods of the document object . The document object is a predefined object in Javascript write ()  : display any type  of data writeln():  Display any type of data and appends a new line  character.
Comments  JavaScript  support two types of comments. There are: Single - line comments Multi - line comments
Esccap Sequences Character There are multiple escape sequence characters in Javascript that provides various kind of formatting.
Built –in Function
JavaScript Keywords Keywords are predefined terms that can not be used as an object name, function name or variable name  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
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
Summary The Javascript runtime engine reads and executes the Javascript code either on the server or in the browser.  The Server element includes JavaScript code, which is executed by the Web Server. The NOSCRIPT element  specifies the alternate content to be displayed, if the browser closes not support Javascript.
Summary… Javascript provides various keywords: break, if, continue, new, this… The toFixed() function that specifies the number of digits to be displayed after the decimal point. The toPrecision() function specifies the number of digits in a number to be displayed to the user. The toString() function transforms a value into string. Building Dynamic Websites/Session 1/   of 16

More Related Content

PPTX
Javascript
PDF
Everything You Need To Know About AngularJS
PDF
Unethical JavaScript - Giorgio Natili - Codemotion Rome 2017
PPT
Javascript Basics
DOCX
Java script basics
PPT
JavaScript Data Types
PPTX
Basics of Javascript
Javascript
Everything You Need To Know About AngularJS
Unethical JavaScript - Giorgio Natili - Codemotion Rome 2017
Javascript Basics
Java script basics
JavaScript Data Types
Basics of Javascript

What's hot (20)

PPTX
Angular Presentation
PPTX
HTML5 - Quick Guide
PPT
Learn javascript easy steps
PPT
Linq e Ef
PDF
TypeScript 2 in action
PPTX
Java script
PPTX
Java script basics
PDF
Javascript
PPTX
Javascript
PPTX
Java script best practices v4
PPTX
20081202 Md Workbench Tool
PPT
Java script Learn Easy
PPTX
JavaScript in Object-Oriented Way
PDF
JavaScript: Patterns, Part 3
PPT
JavaScript Operators
PPT
J Query
PPTX
Apple.combine
PPT
JavaScript
PDF
PDF
Building interactive web app with shiny
Angular Presentation
HTML5 - Quick Guide
Learn javascript easy steps
Linq e Ef
TypeScript 2 in action
Java script
Java script basics
Javascript
Javascript
Java script best practices v4
20081202 Md Workbench Tool
Java script Learn Easy
JavaScript in Object-Oriented Way
JavaScript: Patterns, Part 3
JavaScript Operators
J Query
Apple.combine
JavaScript
Building interactive web app with shiny
Ad

Similar to 08. session 08 intoduction to javascript (20)

PPTX
WT Unit-3 PPT.pptx
PPTX
js.pptx
PPTX
javascript client side scripting la.pptx
PPTX
Java script
PPTX
Javascript
PPTX
Web programming
PPT
chap04.ppt
PDF
Client sidescripting javascript
PDF
PPTX
Java script
PPTX
JavaScript.pptx
PPTX
Lecture 5 javascript
PPTX
JavaScript New Tutorial Class XI and XII.pptx
PDF
javascriptPresentation.pdf
PPTX
Java script session 3
PDF
JavaScript Getting Started
PPTX
Web Technology Part 2
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
PPTX
04-JS.pptx
PPTX
04-JS.pptx
WT Unit-3 PPT.pptx
js.pptx
javascript client side scripting la.pptx
Java script
Javascript
Web programming
chap04.ppt
Client sidescripting javascript
Java script
JavaScript.pptx
Lecture 5 javascript
JavaScript New Tutorial Class XI and XII.pptx
javascriptPresentation.pdf
Java script session 3
JavaScript Getting Started
Web Technology Part 2
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
04-JS.pptx
04-JS.pptx
Ad

More from Phúc Đỗ (15)

PPTX
15. session 15 data binding
PPTX
14. session 14 dhtml filter
PPTX
13. session 13 introduction to dhtml
PPTX
12. session 12 java script objects
PPTX
11. session 11 functions and objects
PPTX
10. session 10 loops and arrays
PPTX
09. session 9 operators and statements
PPT
07. session 07 adv css properties
PPTX
06. session 06 css color_andlayoutpropeties
PPTX
05. session 05 introducing css
PPTX
04. session 04 working withformsandframes
PPT
03. session 03 using lists and tables
PPT
02. session 02 working with html elements
PPTX
15. session 15 data binding
PPT
01. session 01 introduction to html
15. session 15 data binding
14. session 14 dhtml filter
13. session 13 introduction to dhtml
12. session 12 java script objects
11. session 11 functions and objects
10. session 10 loops and arrays
09. session 9 operators and statements
07. session 07 adv css properties
06. session 06 css color_andlayoutpropeties
05. session 05 introducing css
04. session 04 working withformsandframes
03. session 03 using lists and tables
02. session 02 working with html elements
15. session 15 data binding
01. session 01 introduction to html

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
Machine learning based COVID-19 study performance prediction
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MIND Revenue Release Quarter 2 2025 Press Release
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
Building Integrated photovoltaic BIPV_UPV.pdf

08. session 08 intoduction to javascript

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