SlideShare a Scribd company logo
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?
Ad

More Related Content

What's hot (20)

Server-side React with Headless CMS – Exove
Server-side React with Headless CMS – ExoveServer-side React with Headless CMS – Exove
Server-side React with Headless CMS – Exove
Exove
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
RTigger
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
MAGNA COLLEGE OF ENGINEERING
 
Real Browser Check Scripting Guide - Rigor Monitoring
Real Browser Check Scripting Guide - Rigor MonitoringReal Browser Check Scripting Guide - Rigor Monitoring
Real Browser Check Scripting Guide - Rigor Monitoring
Anthony Ferrari
 
Javascripts. pptt
Javascripts. ppttJavascripts. pptt
Javascripts. pptt
RaviShankarSinghal
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
Rajat Pratap Singh
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programming
hchen1
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Raja V
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
Bharat_Kumawat
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
alaa.moustafa
 
Java script
Java scriptJava script
Java script
reddivarihareesh
 
Ajax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web ApplicationsAjax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web Applications
Siva Kumar
 
Languages and tools for web programming
Languages and tools for web  programmingLanguages and tools for web  programming
Languages and tools for web programming
Alamelu
 
AJAX
AJAXAJAX
AJAX
Mukesh Tekwani
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
Smithss25
 
Ajax
AjaxAjax
Ajax
Tech_MX
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
thinkphp
 
Ajax
Ajax Ajax
Ajax
ahmedfaragmostafa
 
Server-side React with Headless CMS – Exove
Server-side React with Headless CMS – ExoveServer-side React with Headless CMS – Exove
Server-side React with Headless CMS – Exove
Exove
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
RTigger
 
Real Browser Check Scripting Guide - Rigor Monitoring
Real Browser Check Scripting Guide - Rigor MonitoringReal Browser Check Scripting Guide - Rigor Monitoring
Real Browser Check Scripting Guide - Rigor Monitoring
Anthony Ferrari
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
Rajat Pratap Singh
 
An Introduction to Ajax Programming
An Introduction to Ajax ProgrammingAn Introduction to Ajax Programming
An Introduction to Ajax Programming
hchen1
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Raja V
 
Ajax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web ApplicationsAjax:From Desktop Applications towards Ajax Web Applications
Ajax:From Desktop Applications towards Ajax Web Applications
Siva Kumar
 
Languages and tools for web programming
Languages and tools for web  programmingLanguages and tools for web  programming
Languages and tools for web programming
Alamelu
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
Smithss25
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
thinkphp
 

Similar to Javascript (20)

javascript-basics.ppt
javascript-basics.pptjavascript-basics.ppt
javascript-basics.ppt
ahmadfaisal744721
 
Java script202
Java script202Java script202
Java script202
Wasiq Zia
 
Java script
Java scriptJava script
Java script
Sukrit Gupta
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
PraveenKumar680401
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulationCS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
Mujtaba Haider
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdf
wildcat9335
 
Java script
Java scriptJava script
Java script
Abhishek Kesharwani
 
Java script
Java scriptJava script
Java script
sanjay joshi
 
Java script
Java scriptJava script
Java script
umesh patil
 
WTA-MODULE-4.pptx
WTA-MODULE-4.pptxWTA-MODULE-4.pptx
WTA-MODULE-4.pptx
ChayapathiAR
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Marlon Jamera
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdf
AAFREEN SHAIKH
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
AlkanthiSomesh
 
HNDIT1022 Week 08, 09 10 Theory web .pptx
HNDIT1022 Week 08, 09  10 Theory web .pptxHNDIT1022 Week 08, 09  10 Theory web .pptx
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 
JavaScript_III.pptx
JavaScript_III.pptxJavaScript_III.pptx
JavaScript_III.pptx
rashmiisrani1
 
Java script202
Java script202Java script202
Java script202
Wasiq Zia
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulationCS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdf
wildcat9335
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Marlon Jamera
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdf
AAFREEN SHAIKH
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
AlkanthiSomesh
 
HNDIT1022 Week 08, 09 10 Theory web .pptx
HNDIT1022 Week 08, 09  10 Theory web .pptxHNDIT1022 Week 08, 09  10 Theory web .pptx
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 
Ad

Recently uploaded (20)

Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Ad

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.