SlideShare a Scribd company logo
JavaScript
- Vidyut Singhania
Wha’ ?
• JavaScript
• Scripting language of
the Web
Why
..?
• 1. HTML – Define
CONTENT of WP
• 2. CSS – Specify LAYOUT of
WP
• 3. JS – Specify the
BEHAVIOR of WP
Who
gives ?!
• YOU should!
• This single language forms
the basis for various other
languages – AJAX, JSON for
eg!
Speaking in English
Extremely
popular &
widespread
Scripting
Lang. for PC
Primarily
used for
Client-side
Scripting
Highly
used in
Web
Browsers
JS
• Built by Brendan Eich of Mozilla fame.
• Though originally called “Mocha”, it was shipped
as JavaScript when deployed on NetScape.
• It is a cross-platform, OO scripting language.
• Enable dynamic WPs through user interaction
and on-screen special effects.
• Provides Server-Side (MongoDB/Node.js) &
Client-Side Scripting (rollover, alert)
• P.S. NOT THE SAME AS JAVA!
Types of JS
Types of JS
Client Side
Scripting
Supplies objects to
control the browser
& its DOM
Allow apps to place
elements on HTML
form & respond to
user events
Server Side
Scripting
Allow app to
communicate with RDB
or perform file
manipulation on server.
Share info across users
of an app or connect
with other apps using
LiveConnect & Java.
Components of JS
JS Tags Description
<script> & </script> Only JS statements b/w these tags
<script src=“myScript.js”></script> Using/Importing external JS files
var price = 10 || var name=“Smith” Declare variables using keyword ‘ var ‘
alert(“msg”) || confirm(“msg”) ||
prompt(“msg”)
Inbuilt functions in JS
function showAlert(“msg”)
{
alert(“msg")
}
User defined functions in JS
objName || objName.propName ||
objName.methodName()
Refer to an object, property of obj & method
of obj respectively
Math – provides for math calculations
Date – provides date & time info
String – provides for string manipulation
Some of the built-in language objects of JS
Document Object
• The Document object represents the Web page
that is loaded in the browser window, and the
content displayed on that page, including text
and form elements.
• Document Methods
– You can use the methods of the document object to
work on a Web page.
– Here are the most common document methods:
• • write() - write a string to the Web page
• • open() - opens a new document
• • close() - closes the document
Formatting What is Written
• Document Properties
– • bgColor
– • fgColor
– • linkColor
– • vlinkColor
– • title
– • lastModified
DOM formatted Example
<SCRIPT language="JavaScript">
function newPage() {
var userName = prompt("Please enter your name:","")
document.write("<H1>Welcome " + userName +
"</H1><BR>")
document.write("<H2>to your new home page.</H2>")
}
</SCRIPT>
Window Object
• The window object represents the browser window.
• There are only two main window properties. They are:
– • status - set the status bar message
– • self - stores the name mof the current window
• Window Methods
• The window methods are mainly for opening and closing new
windows.
• The following are the main window methods. They are:
– • alert() - to display a message box
– • confirm() - to display a confirmation box
– • prompt() - to display a prompt box
– • open() - to open a new window
– • close() - to close a window
Window Attributes
• If the default new window does not suit your needs,
you can specify different features of the window when
you open it. The complete syntax of the
"window.open" is as follow:
– window.open(URL, windowName, featureList)
• By default, if you do not specify any features, then a
window will have all of them. The following are the
window attributes:
– • toolbar
– • menubar
– • scrollbars
– • resizeable
– • status
– • location
– • directories
Events
• some of the most common events:
– • onLoad - occurs when a page loads in a browser
– • onUnload - occurs just before the user exits a
page
– • onMouseOver - occurs when you point to an
object
– • onMouseOut - occurs when you point away
from an object
– • onSubmit - occurs when you submit a form
– • onClick - occurs when an object is clicked
Advantages Disadvantages
JavaScript
Ad

More Related Content

What's hot (20)

An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
Emanuele DelBono
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
 
Javascript
JavascriptJavascript
Javascript
D V BHASKAR REDDY
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Joseph de Castelnau
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
Hassan Ahmed Baig - Web Developer
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
shreesenthil
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
Sergey Romaneko
 
Java script ppt
Java script pptJava script ppt
Java script ppt
The Health and Social Care Information Centre
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
Thanh Tuong
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
Bala Narayanan
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
Gabriele Lana
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
Jalpesh Vasa
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Intro to Asynchronous Javascript
Intro to Asynchronous JavascriptIntro to Asynchronous Javascript
Intro to Asynchronous Javascript
Garrett Welson
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
Emanuele DelBono
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
Thanh Tuong
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
Gabriele Lana
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Intro to Asynchronous Javascript
Intro to Asynchronous JavascriptIntro to Asynchronous Javascript
Intro to Asynchronous Javascript
Garrett Welson
 

Similar to JavaScript (20)

Easy javascript
Easy javascriptEasy javascript
Easy javascript
Bui Kiet
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
prince Loffar
 
INTRO TO JAVASCRIPT basic to adcance.ppt
INTRO TO JAVASCRIPT basic to adcance.pptINTRO TO JAVASCRIPT basic to adcance.ppt
INTRO TO JAVASCRIPT basic to adcance.ppt
testvarun21
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JS
brendankowitz
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
Borey Lim
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
koppenolski
 
JavaScript and BOM events
JavaScript and BOM eventsJavaScript and BOM events
JavaScript and BOM events
Jussi Pohjolainen
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
Nirvanic Labs
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)
brendankowitz
 
Front end for back end developers
Front end for back end developersFront end for back end developers
Front end for back end developers
Wojciech Bednarski
 
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
Bruce Lawson, Web Development 2.0, SparkUp! Poznan PolandBruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
brucelawson
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
Fabian Jakobs
 
An overview of JavaScript
An overview of JavaScriptAn overview of JavaScript
An overview of JavaScript
Poluru S
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
Gurpreet singh
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
drudolph11
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
dipen55
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
Julie Meloni
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Jussi Pohjolainen
 
Javascript
JavascriptJavascript
Javascript
Mozxai
 
Easy javascript
Easy javascriptEasy javascript
Easy javascript
Bui Kiet
 
Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
prince Loffar
 
INTRO TO JAVASCRIPT basic to adcance.ppt
INTRO TO JAVASCRIPT basic to adcance.pptINTRO TO JAVASCRIPT basic to adcance.ppt
INTRO TO JAVASCRIPT basic to adcance.ppt
testvarun21
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JS
brendankowitz
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
Borey Lim
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
koppenolski
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
Nirvanic Labs
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)
brendankowitz
 
Front end for back end developers
Front end for back end developersFront end for back end developers
Front end for back end developers
Wojciech Bednarski
 
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
Bruce Lawson, Web Development 2.0, SparkUp! Poznan PolandBruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
Bruce Lawson, Web Development 2.0, SparkUp! Poznan Poland
brucelawson
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
Fabian Jakobs
 
An overview of JavaScript
An overview of JavaScriptAn overview of JavaScript
An overview of JavaScript
Poluru S
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
Gurpreet singh
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
drudolph11
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
dipen55
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
Julie Meloni
 
Javascript
JavascriptJavascript
Javascript
Mozxai
 
Ad

Recently uploaded (20)

What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Ad

JavaScript

  • 2. Wha’ ? • JavaScript • Scripting language of the Web Why ..? • 1. HTML – Define CONTENT of WP • 2. CSS – Specify LAYOUT of WP • 3. JS – Specify the BEHAVIOR of WP Who gives ?! • YOU should! • This single language forms the basis for various other languages – AJAX, JSON for eg!
  • 3. Speaking in English Extremely popular & widespread Scripting Lang. for PC Primarily used for Client-side Scripting Highly used in Web Browsers
  • 4. JS • Built by Brendan Eich of Mozilla fame. • Though originally called “Mocha”, it was shipped as JavaScript when deployed on NetScape. • It is a cross-platform, OO scripting language. • Enable dynamic WPs through user interaction and on-screen special effects. • Provides Server-Side (MongoDB/Node.js) & Client-Side Scripting (rollover, alert) • P.S. NOT THE SAME AS JAVA!
  • 5. Types of JS Types of JS Client Side Scripting Supplies objects to control the browser & its DOM Allow apps to place elements on HTML form & respond to user events Server Side Scripting Allow app to communicate with RDB or perform file manipulation on server. Share info across users of an app or connect with other apps using LiveConnect & Java.
  • 7. JS Tags Description <script> & </script> Only JS statements b/w these tags <script src=“myScript.js”></script> Using/Importing external JS files var price = 10 || var name=“Smith” Declare variables using keyword ‘ var ‘ alert(“msg”) || confirm(“msg”) || prompt(“msg”) Inbuilt functions in JS function showAlert(“msg”) { alert(“msg") } User defined functions in JS objName || objName.propName || objName.methodName() Refer to an object, property of obj & method of obj respectively Math – provides for math calculations Date – provides date & time info String – provides for string manipulation Some of the built-in language objects of JS
  • 8. Document Object • The Document object represents the Web page that is loaded in the browser window, and the content displayed on that page, including text and form elements. • Document Methods – You can use the methods of the document object to work on a Web page. – Here are the most common document methods: • • write() - write a string to the Web page • • open() - opens a new document • • close() - closes the document
  • 9. Formatting What is Written • Document Properties – • bgColor – • fgColor – • linkColor – • vlinkColor – • title – • lastModified
  • 10. DOM formatted Example <SCRIPT language="JavaScript"> function newPage() { var userName = prompt("Please enter your name:","") document.write("<H1>Welcome " + userName + "</H1><BR>") document.write("<H2>to your new home page.</H2>") } </SCRIPT>
  • 11. Window Object • The window object represents the browser window. • There are only two main window properties. They are: – • status - set the status bar message – • self - stores the name mof the current window • Window Methods • The window methods are mainly for opening and closing new windows. • The following are the main window methods. They are: – • alert() - to display a message box – • confirm() - to display a confirmation box – • prompt() - to display a prompt box – • open() - to open a new window – • close() - to close a window
  • 12. Window Attributes • If the default new window does not suit your needs, you can specify different features of the window when you open it. The complete syntax of the "window.open" is as follow: – window.open(URL, windowName, featureList) • By default, if you do not specify any features, then a window will have all of them. The following are the window attributes: – • toolbar – • menubar – • scrollbars – • resizeable – • status – • location – • directories
  • 13. Events • some of the most common events: – • onLoad - occurs when a page loads in a browser – • onUnload - occurs just before the user exits a page – • onMouseOver - occurs when you point to an object – • onMouseOut - occurs when you point away from an object – • onSubmit - occurs when you submit a form – • onClick - occurs when an object is clicked

Editor's Notes

  • #3: All modern HTML pages are using JavaScript