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
PPTX
Training presentation
PPTX
Javascript 01 (js)
PDF
AJAX - An introduction
PDF
HTML5 - An introduction
PPT
Session vii(java scriptbasics)
PPTX
Jqueryppt (1)
PDF
Angular - Chapter 7 - HTTP Services
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Training presentation
Javascript 01 (js)
AJAX - An introduction
HTML5 - An introduction
Session vii(java scriptbasics)
Jqueryppt (1)
Angular - Chapter 7 - HTTP Services

What's hot (20)

PDF
Server-side React with Headless CMS – Exove
PPTX
AJAX, JSON, and Client-Side Templates
PDF
Real Browser Check Scripting Guide - Rigor Monitoring
PPTX
Javascripts. pptt
PPT
Web development basics (Part-2)
PPT
An Introduction to Ajax Programming
PPTX
Introduction to ajax
PPTX
Ajax presentation
PPT
Ajax Presentation
PPTX
Java script
PPTX
Ajax:From Desktop Applications towards Ajax Web Applications
PPTX
Languages and tools for web programming
PPTX
Ajax ppt - 32 slides
PPTX
Ajax
PDF
Angular - Chapter 6 - Firebase Integration
PDF
Introduction to ajax
PDF
Ajax Introduction Presentation
Server-side React with Headless CMS – Exove
AJAX, JSON, and Client-Side Templates
Real Browser Check Scripting Guide - Rigor Monitoring
Javascripts. pptt
Web development basics (Part-2)
An Introduction to Ajax Programming
Introduction to ajax
Ajax presentation
Ajax Presentation
Java script
Ajax:From Desktop Applications towards Ajax Web Applications
Languages and tools for web programming
Ajax ppt - 32 slides
Ajax
Angular - Chapter 6 - Firebase Integration
Introduction to ajax
Ajax Introduction Presentation
Ad

Similar to Javascript (20)

PDF
Basic JavaScript Tutorial
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
PPTX
JavaScript_III.pptx
PPTX
JavaScript with Syntax & Implementation
PPTX
Java script
PDF
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
PDF
javascriptPresentation.pdf
PPTX
Lecture 5 javascript
PDF
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
PPTX
Java script
PDF
8.-Javascript-report powerpoint presentation
PDF
Iwt note(module 2)
PPTX
Java Script basics and DOM
PPTX
Java script
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
DOC
2javascript web programming with JAVA script
PPT
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
PDF
Ch3- Java Script.pdf
PPTX
JavaScript
PPTX
Javascript
Basic JavaScript Tutorial
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
JavaScript_III.pptx
JavaScript with Syntax & Implementation
Java script
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
javascriptPresentation.pdf
Lecture 5 javascript
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
Java script
8.-Javascript-report powerpoint presentation
Iwt note(module 2)
Java Script basics and DOM
Java script
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
2javascript web programming with JAVA script
JAVA SCRIPT.pptbbdndndmdndndndndnndmmddnndn
Ch3- Java Script.pdf
JavaScript
Javascript
Ad

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
System and Network Administraation Chapter 3
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Nekopoi APK 2025 free lastest update
medical staffing services at VALiNTRY
Adobe Illustrator 28.6 Crack My Vision of Vector Design
System and Network Administraation Chapter 3
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Operating system designcfffgfgggggggvggggggggg
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Upgrade and Innovation Strategies for SAP ERP Customers
How Creative Agencies Leverage Project Management Software.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
ManageIQ - Sprint 268 Review - Slide Deck
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ISO 45001 Occupational Health and Safety Management System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo POS Development Services by CandidRoot Solutions
Understanding Forklifts - TECH EHS Solution
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Online Work Permit System for Fast Permit Processing
Nekopoi APK 2025 free lastest update

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.