SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
Introduction to Website Design & Development
What is JavaScript?
“JavaScript is a programming language designed for Web pages”
Commonly refereed to as Scripting language which means lightweight
programming language.
What is a programming language?
“It is a vocabulary and set of rules for instructing a computer or computing device
to perform specific tasks”
Examples include:
Python, Java, C#, C++, Perl….
Why Use JavaScript?
• JavaScript enhances Web pages with dynamic and interactive
features.
• JavaScript runs in client side(Browsers) software .
• JavaScript 1.3 works with version 4.0 browsers.
What Can JavaScript Do?
• Common JavaScript tasks can replace server-side scripting.
• JavaScript enables shopping carts, form validation, calculations,
special graphic and text effects, clocks, and more.
• JavaScript can put dynamic text into an HTML page
• JavaScript can be used to detect the visitor’s browser
• JavaScript can be used to create cookies
• Store and retrieve information on the visitor’s computer
JavaScript Syntax
• Unlike HTML, JavaScript is case sensitive.
• Dot Syntax is used to combine terms.
• e.g., document.write("Hello World")
• Certain characters and terms are reserved.
• JavaScript is simple text (ASCII).
JavaScript Terminology
• JavaScript programming uses specialized terminology.
• Understanding JavaScript terms is fundamental to understanding the
script.
• Objects, Properties, Methods, Events, Functions, Values, Variables,
Expressions, Operators.
Objects
• Objects refers to windows, documents, images, tables, forms, buttons
or links, etc.
• Objects should be named.
• Objects have properties that act as modifiers.
Properties
• Properties are object attributes.
• Object properties are defined by using the object's name, a period,
and the property name.
• e.g., background color is expressed by:
• document.bgcolor .
• document is the object.
• bgcolor is the property.
Methods
• Methods are actions applied to particular objects. Methods are what
objects can do.
• e.g. document.write(”Hello World")
• document is the object.
• write is the method.
Events
• Events associate an object with an action.
• e.g., the OnMouseover event handler action can change an image.
• e.g., the onSubmit event handler sends a form.
• User actions trigger events.
Functions
• Functions are named statements that performs tasks.
• e.g., function doWhatever () {statement here}
• The curly braces contain the statements of the function.
• JavaScript has built-in functions, and you can write your own.
Values
• Values are bits of information.
• Values types and some examples include:
• Number: 1, 2, 3, etc.
• String: characters enclosed in quotes.
• Boolean: true or false.
• Object: image, form
• Function: validate, doWhatever
Variables
• Variables contain values and use the equal sign to specify their value.
• Variables are created by declaration using the var command with or
without an initial value state.
• e.g. var month;
• e.g. var month = August;
Expressions
• Expressions are commands that assign values to variables.
• Expressions always use an assignment operator, such as the equals
sign.
• e.g., var month = May; is an expression.
• Expressions end with a semicolon.
Operators
• Operators are used to handle variables.
• Types of operators with examples:
• Arithmetic operators, such as +, - .
• Comparisons operators, such as equals.
• Logical operators, such as and.
• Control operators, such as if.
• Assignment and String operators.
Methods of Using JavaScript
1. JavaScripts can reside in a separate page.
2. JavaScript can be embedded in HTML documents -- in the <head>,
in the <body>, or in both.
3. JavaScript object attributes can be placed in HTML element tags.
e.g., <body onLoad="alert('WELCOME')">
1. Using Separate JavaScript Files
• Linking can be advantageous if many pages use the same script.
• Use the source element to link to the script file.
• <script src="myjavascript.js”
• language="JavaScript1.2”
• type="text/javascript">
• </script>
2. Embedding JavaScript in HTML
• When specifying a script only the tags <script> and </script>
are essential, but complete specification is recommended:
<script language="javascript”
type="text/javascript">
<!-- Begin hiding
window.location=”index.html"
// End hiding script-->
</script>
3. Using JavaScript in HTML Tags.
• Event handlers like onMouseover are a perfect example of an easy to
add tag script.
• <a href=”index.html”
• onMouseover="document.logo.src='js2.gif'"
• onMouseout="document.logo.src='js.gif'">
• <img src="js.gif" name="logo">
• </a>
Creating an Alert Message
• The following script in the <body> tag uses the onLoad event to
display an Alert window
• The message is specified within parenthesis.
• <body onLoad="alert('WELCOME. Enjoy your
visit. Your feedback can improve cyberspace.
Please let me know if you detect any problems.
Thank you.')">
Using Comment Tags
• HTML comment tags should bracket any script.
• The <!-- script here --> tags hide scripts in HTML and
prevent scripts from displaying in browsers that do not interpret
JavaScript.
• Double slashes // are the signal characters for a JavaScript single-
line comment.
Questions?

More Related Content

PPTX
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Training presentation
Tayseer_Emam
 
PPTX
Javascript 01 (js)
AbhishekMondal42
 
PDF
AJAX - An introduction
Eleonora Ciceri
 
PDF
HTML5 - An introduction
Eleonora Ciceri
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PPTX
Jqueryppt (1)
AndreaSmile06
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Training presentation
Tayseer_Emam
 
Javascript 01 (js)
AbhishekMondal42
 
AJAX - An introduction
Eleonora Ciceri
 
HTML5 - An introduction
Eleonora Ciceri
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
Jqueryppt (1)
AndreaSmile06
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 

What's hot (20)

PDF
Server-side React with Headless CMS – Exove
Exove
 
PPTX
AJAX, JSON, and Client-Side Templates
RTigger
 
PDF
Real Browser Check Scripting Guide - Rigor Monitoring
Anthony Ferrari
 
PPTX
Javascripts. pptt
RaviShankarSinghal
 
PPT
Web development basics (Part-2)
Rajat Pratap Singh
 
PPT
An Introduction to Ajax Programming
hchen1
 
PPTX
Introduction to ajax
Raja V
 
PPTX
Ajax presentation
Bharat_Kumawat
 
PPT
Ajax Presentation
alaa.moustafa
 
PPTX
Java script
reddivarihareesh
 
PPTX
Ajax:From Desktop Applications towards Ajax Web Applications
Siva Kumar
 
PPTX
Languages and tools for web programming
Alamelu
 
PPTX
Ajax ppt - 32 slides
Smithss25
 
PPTX
Ajax
Tech_MX
 
PDF
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
PDF
Introduction to ajax
Nir Elbaz
 
PDF
Ajax Introduction Presentation
thinkphp
 
Server-side React with Headless CMS – Exove
Exove
 
AJAX, JSON, and Client-Side Templates
RTigger
 
Real Browser Check Scripting Guide - Rigor Monitoring
Anthony Ferrari
 
Javascripts. pptt
RaviShankarSinghal
 
Web development basics (Part-2)
Rajat Pratap Singh
 
An Introduction to Ajax Programming
hchen1
 
Introduction to ajax
Raja V
 
Ajax presentation
Bharat_Kumawat
 
Ajax Presentation
alaa.moustafa
 
Java script
reddivarihareesh
 
Ajax:From Desktop Applications towards Ajax Web Applications
Siva Kumar
 
Languages and tools for web programming
Alamelu
 
Ajax ppt - 32 slides
Smithss25
 
Ajax
Tech_MX
 
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Introduction to ajax
Nir Elbaz
 
Ajax Introduction Presentation
thinkphp
 
Ad

Similar to Javascript (20)

PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
PPTX
JavaScript_III.pptx
rashmiisrani1
 
PPTX
JavaScript with Syntax & Implementation
Soumen Santra
 
PPTX
Java script
Sukrit Gupta
 
PDF
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
sharvaridhokte
 
PDF
javascriptPresentation.pdf
wildcat9335
 
PPTX
Lecture 5 javascript
Mujtaba Haider
 
PDF
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
PPTX
Java script
Shyam Khant
 
PDF
8.-Javascript-report powerpoint presentation
JohnLagman3
 
PDF
Iwt note(module 2)
SANTOSH RATH
 
PPTX
Java Script basics and DOM
Sukrit Gupta
 
PPTX
Java script
Rajkiran Mummadi
 
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
DOC
2javascript web programming with JAVA script
umardanjumamaiwada
 
PPT
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
harshithunnam715
 
PDF
Ch3- Java Script.pdf
HASENSEID
 
PPTX
JavaScript
Vidyut Singhania
 
PPTX
Javascript
Nagarajan
 
Basic JavaScript Tutorial
DHTMLExtreme
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
JavaScript_III.pptx
rashmiisrani1
 
JavaScript with Syntax & Implementation
Soumen Santra
 
Java script
Sukrit Gupta
 
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
sharvaridhokte
 
javascriptPresentation.pdf
wildcat9335
 
Lecture 5 javascript
Mujtaba Haider
 
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
Java script
Shyam Khant
 
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Iwt note(module 2)
SANTOSH RATH
 
Java Script basics and DOM
Sukrit Gupta
 
Java script
Rajkiran Mummadi
 
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
2javascript web programming with JAVA script
umardanjumamaiwada
 
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
harshithunnam715
 
Ch3- Java Script.pdf
HASENSEID
 
JavaScript
Vidyut Singhania
 
Javascript
Nagarajan
 
Ad

Recently uploaded (20)

PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PPTX
AIRLINE PRICE API | FLIGHT API COST |
philipnathen82
 
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PDF
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
AIRLINE PRICE API | FLIGHT API COST |
philipnathen82
 
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
Community & News Update Q2 Meet Up 2025
VictoriaMetrics
 
oapresentation.pptx
mehatdhavalrajubhai
 

Javascript

  • 1. Introduction to Website Design & Development
  • 2. What is JavaScript? “JavaScript is a programming language designed for Web pages” Commonly refereed to as Scripting language which means lightweight programming language. What is a programming language? “It is a vocabulary and set of rules for instructing a computer or computing device to perform specific tasks” Examples include: Python, Java, C#, C++, Perl….
  • 3. Why Use JavaScript? • JavaScript enhances Web pages with dynamic and interactive features. • JavaScript runs in client side(Browsers) software . • JavaScript 1.3 works with version 4.0 browsers.
  • 4. What Can JavaScript Do? • Common JavaScript tasks can replace server-side scripting. • JavaScript enables shopping carts, form validation, calculations, special graphic and text effects, clocks, and more. • JavaScript can put dynamic text into an HTML page • JavaScript can be used to detect the visitor’s browser • JavaScript can be used to create cookies • Store and retrieve information on the visitor’s computer
  • 5. JavaScript Syntax • Unlike HTML, JavaScript is case sensitive. • Dot Syntax is used to combine terms. • e.g., document.write("Hello World") • Certain characters and terms are reserved. • JavaScript is simple text (ASCII).
  • 6. JavaScript Terminology • JavaScript programming uses specialized terminology. • Understanding JavaScript terms is fundamental to understanding the script. • Objects, Properties, Methods, Events, Functions, Values, Variables, Expressions, Operators.
  • 7. Objects • Objects refers to windows, documents, images, tables, forms, buttons or links, etc. • Objects should be named. • Objects have properties that act as modifiers.
  • 8. Properties • Properties are object attributes. • Object properties are defined by using the object's name, a period, and the property name. • e.g., background color is expressed by: • document.bgcolor . • document is the object. • bgcolor is the property.
  • 9. Methods • Methods are actions applied to particular objects. Methods are what objects can do. • e.g. document.write(”Hello World") • document is the object. • write is the method.
  • 10. Events • Events associate an object with an action. • e.g., the OnMouseover event handler action can change an image. • e.g., the onSubmit event handler sends a form. • User actions trigger events.
  • 11. Functions • Functions are named statements that performs tasks. • e.g., function doWhatever () {statement here} • The curly braces contain the statements of the function. • JavaScript has built-in functions, and you can write your own.
  • 12. Values • Values are bits of information. • Values types and some examples include: • Number: 1, 2, 3, etc. • String: characters enclosed in quotes. • Boolean: true or false. • Object: image, form • Function: validate, doWhatever
  • 13. Variables • Variables contain values and use the equal sign to specify their value. • Variables are created by declaration using the var command with or without an initial value state. • e.g. var month; • e.g. var month = August;
  • 14. Expressions • Expressions are commands that assign values to variables. • Expressions always use an assignment operator, such as the equals sign. • e.g., var month = May; is an expression. • Expressions end with a semicolon.
  • 15. Operators • Operators are used to handle variables. • Types of operators with examples: • Arithmetic operators, such as +, - . • Comparisons operators, such as equals. • Logical operators, such as and. • Control operators, such as if. • Assignment and String operators.
  • 16. Methods of Using JavaScript 1. JavaScripts can reside in a separate page. 2. JavaScript can be embedded in HTML documents -- in the <head>, in the <body>, or in both. 3. JavaScript object attributes can be placed in HTML element tags. e.g., <body onLoad="alert('WELCOME')">
  • 17. 1. Using Separate JavaScript Files • Linking can be advantageous if many pages use the same script. • Use the source element to link to the script file. • <script src="myjavascript.js” • language="JavaScript1.2” • type="text/javascript"> • </script>
  • 18. 2. Embedding JavaScript in HTML • When specifying a script only the tags <script> and </script> are essential, but complete specification is recommended: <script language="javascript” type="text/javascript"> <!-- Begin hiding window.location=”index.html" // End hiding script--> </script>
  • 19. 3. Using JavaScript in HTML Tags. • Event handlers like onMouseover are a perfect example of an easy to add tag script. • <a href=”index.html” • onMouseover="document.logo.src='js2.gif'" • onMouseout="document.logo.src='js.gif'"> • <img src="js.gif" name="logo"> • </a>
  • 20. Creating an Alert Message • The following script in the <body> tag uses the onLoad event to display an Alert window • The message is specified within parenthesis. • <body onLoad="alert('WELCOME. Enjoy your visit. Your feedback can improve cyberspace. Please let me know if you detect any problems. Thank you.')">
  • 21. Using Comment Tags • HTML comment tags should bracket any script. • The <!-- script here --> tags hide scripts in HTML and prevent scripts from displaying in browsers that do not interpret JavaScript. • Double slashes // are the signal characters for a JavaScript single- line comment.