SlideShare a Scribd company logo
JavaScript Basics
 JavaScript is a programming language designed for Web
pages that describes data and procedures in terms of
objects, methods, and properties, rather than variables,
routines, and statements.
 Unlike HTML, JavaScript is case sensitive. JavaScript is
plain text and when created in a text editor needs to be
saved as a text (ASCII) file.
 Newer editions of full featured WYSIWYG HTML editors
support some Java Scripting, and often enable coding in
their page source windows.
 If you begin doing JavaScript by cutting and pasting you
may often need to modify a few parts of the scripts, such
as names of objects. Many JavaScript's are available on
the WWW, and links to some popular JavaScript sites are
provided below.
 A team of Netscape and Sun Microsystems developers
originally created JavaScript.
 In 1998 the European Computer Manfacturers
Association (ECMA) announced the adoption of a
standard Internet scripting language based on JavaScript
1.1 that resolved the incompatibilities that existed in
scripting between various browser implementations.
Microsoft, Netscape,
 and other browser companies agreed to follow the
specification. The standard is called ECMAScript,
though the common name, JavaScript, has persisted.
The most recent version of JavaScript is 1.3 (ECMA-
262).
 Version 1.3 requires Netscape 4.06 or
 newer and Microsoft Internet Explorer (IE) 4.0 or newer.
 IE actually uses JScript, a modified version of JavaScript
that does not support all JavaScript commands.
 I therefore recommend testing your pages, and using a
Netscape browser when viewing Web pages with
JavaScripting.
 JavaScript can enhance the dynamics and interactive
features of Web pages by enabling calculations,
checking forms, writing interactive games, adding
special effects, customizing graphics selections, data
binding, and more. JavaScript is an interpreted
language that runs in the user's browser
 . JavaScript code works on any computer platform
with a JavaScript capable browser, such as
Navigator 2.0 or later,
 or Microsoft Internet Explorer 3.0 or later.
JavaScript capable browsers may allow disabling
JavaScript in their preferences. JavaScript is easier
to use than are programming languages.
 With JavaScript, developers do not need to compile
a program or work with a developer's kit. Also, the
many JavaScripts available on the Internet can
easily be modified and adapted to your own pages.
JavaScript programming uses specialized terminology.
◦ Dot Syntax
◦ Objects.
◦ Properties
◦ Methods
◦ Events
◦ Functions
◦ Variables
◦ Expressions
◦ Operators
 . Actions by page users trigger event handler
commands in the JavaScript. The program will
then perform whatever commands are assigned to
the event
 . Common event handlers are listed in the following table.
Event Handler Action
onAbort The user stopped loading a page
onBlur The user moves from an object
onChange The user changed an object
onClick The user mouse-clicked an object
onError An error occurred in the script
Event Handler Action
onMouseover The cursor has moved over the object
onMouseout The cursor has moved off the object
onSelect The user selected the object
onSubmit The user submitted a form
onUnload The user leaves the window
onFocus The user activates an object
onLoad The object has been loaded
 JavaScript scripts can be embedded in an HTML page or
can reside in a separate page.
 JavaScript is often placed in the <head> section of the
HTML document, but can also be placed in the <body>.
 JavaScript object attributes can also be placed in HTML
element tags. You can use JavaScript in an HTML
document in the following ways:
 As statements and functions within <script> and
</script> tags.
 By specifying a file as the JavaScript source using the
<src> attribute of the <script> element.
 By specifying a JavaScript expression as the value of an
HTML attribute and as event handlers within certain
other HTML tags.
 The first method places the JavaScript between the
<script> and </script> tags. When specifying a script
only the tags <script> and </script> are essential.
 It is recommendable to specify the script language as an
attribute of the script element. Browsers currently
assume JavaScript, but other programming languages
could become popular in the future.
 The standard to open scripting is <script
language="JavaScript">.
 The script language attribute can also specify the
version of JavaScript.
 It is also recommendable to specify the MIME type of
the script, to denote to the browser that the script is
plain text. This is accomplished with the attribute
type="text/javascript".
 The following example script redirects the browser to a page,
named javascript.html. The object is window, the variable property
is location, and the value equals the specified HTML file.
 <script language="javascript1.2" type="text/javascript">
<!-- Begin hiding script
window.location="javascript.html"
// End hiding script-->
</script>
 In the following examples I do not include the
<script>and </script> tags,
 HTML tags or comment lines. These examples are
employed using the methods described above.
 The first example is a method for displaying text in a
Web page.
 The syntax for this method can also be writeIn, a
method that attaches a break to each line of text.

 document.write("This is where you place the text
that will appear in the Web page.")
 The write method also permits use of HTML tags
within the parenthesis, as seen below.
 document.write("<b>Hello World.</b>")
 The writeIn method should be used with
preformatted text.
 var month = April;
var date = fifteenth;
 document.write("Remember, your taxes are due on
" + month + date);

More Related Content

PPT
Java Script
PPTX
Java Script
PPT
Java script
PPT
Java script
PPTX
JavaScript: Implementations And Applications
PPT
JavaScript Missing Manual, Ch. 1
PPTX
Web topic 21 pass info via javascript
PPTX
Introduction to Java Script
Java Script
Java Script
Java script
Java script
JavaScript: Implementations And Applications
JavaScript Missing Manual, Ch. 1
Web topic 21 pass info via javascript
Introduction to Java Script

What's hot (19)

PPTX
JavaScript with Syntax & Implementation
PPTX
Java script
PPT
Java script
PPTX
1. java script language fundamentals
PPTX
Presentation
DOC
Basics java scripts
RTF
Java scripts
PPTX
Javascript
PDF
Javascript - Ebook (A Quick Guide)
PDF
Introduction to Javascript programming
PPTX
Java script
PPTX
Presentation
PPTX
Java Script An Introduction By HWA
PPT
INFO 3775 Chapter 2 Part 1
PPTX
Java script Basic
PPTX
Java script Session No 1
PDF
Ui automation
JavaScript with Syntax & Implementation
Java script
Java script
1. java script language fundamentals
Presentation
Basics java scripts
Java scripts
Javascript
Javascript - Ebook (A Quick Guide)
Introduction to Javascript programming
Java script
Presentation
Java Script An Introduction By HWA
INFO 3775 Chapter 2 Part 1
Java script Basic
Java script Session No 1
Ui automation
Ad

Viewers also liked (16)

PDF
CV_Mark Fayle _Brief
PPTX
Evaluation 3
PPTX
Global Health and Human Hair
PPTX
Question 1
PDF
Communify - Unit Testing
PPTX
NaviSolutions, de ERP oplossing voor uw groei!
PPTX
Introduction to android
PDF
喜多福香蒜油
PDF
IJISET_V2_I6_90
PDF
Do's and Dont's for Your 341 Meeting of Creditors
DOCX
intMutual funds
PDF
Επιληψία και Ψυχοθεραπεία Δημιουργική προσαρμογή
PPTX
Rimskoe
PPT
Education in-pakistan
PDF
CAFR 2012
PPTX
The Fastest Storage solution, HFT report
CV_Mark Fayle _Brief
Evaluation 3
Global Health and Human Hair
Question 1
Communify - Unit Testing
NaviSolutions, de ERP oplossing voor uw groei!
Introduction to android
喜多福香蒜油
IJISET_V2_I6_90
Do's and Dont's for Your 341 Meeting of Creditors
intMutual funds
Επιληψία και Ψυχοθεραπεία Δημιουργική προσαρμογή
Rimskoe
Education in-pakistan
CAFR 2012
The Fastest Storage solution, HFT report
Ad

Similar to Session vii(java scriptbasics) (20)

PPT
JAVA SCRIPT
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
PDF
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
PDF
Web programming UNIT II by Bhavsingh Maloth
PPTX
JavaScript
DOCX
Javascript tutorial
PPT
Learn javascript easy steps
PPT
Easy javascript
PPT
Java script
PDF
An introduction to JavaScript Scripting Programming
PPTX
Client side scripting using Javascript
PDF
Basic JavaScript Tutorial
DOCX
JavaScript
DOC
Java script by Act Academy
PPTX
Javascript 01 (js)
PPT
Java script202
PPT
basics of javascript and fundamentals ppt
PPT
Javascript overview and introduction to js
PPT
JS-Slides-1 (1).ppt vbefgvsdfgdfgfggergertgrtgrtgt
PPT
JS-Slides_for_begineers_javascript-1.ppt
JAVA SCRIPT
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Web programming UNIT II by Bhavsingh Maloth
JavaScript
Javascript tutorial
Learn javascript easy steps
Easy javascript
Java script
An introduction to JavaScript Scripting Programming
Client side scripting using Javascript
Basic JavaScript Tutorial
JavaScript
Java script by Act Academy
Javascript 01 (js)
Java script202
basics of javascript and fundamentals ppt
Javascript overview and introduction to js
JS-Slides-1 (1).ppt vbefgvsdfgdfgfggergertgrtgrtgt
JS-Slides_for_begineers_javascript-1.ppt

More from Shrijan Tiwari (11)

PPT
ASPX Session xi(page lifecycle)
PPT
Session x(ado.net)
PPT
Session viii(state mngtserver)
PPT
Session viii(state mngtclient)
PPT
Session vi(user control)
PPTX
Session v(css)
PPT
Session ix(database)
PPT
Session iv(master pages)
PPT
Session iii(server controls)
PPTX
Session ii(html)
PPT
Session i(introduction)
ASPX Session xi(page lifecycle)
Session x(ado.net)
Session viii(state mngtserver)
Session viii(state mngtclient)
Session vi(user control)
Session v(css)
Session ix(database)
Session iv(master pages)
Session iii(server controls)
Session ii(html)
Session i(introduction)

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
How a Careem Clone App Allows You to Compete with Large Mobility Brands
PDF
AI in Product Development-omnex systems
PDF
Best Practices for Rolling Out Competency Management Software.pdf
PPTX
CRUISE TICKETING SYSTEM | CRUISE RESERVATION SOFTWARE
PDF
Become an Agentblazer Champion Challenge
PPTX
Presentation of Computer CLASS 2 .pptx
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
Become an Agentblazer Champion Challenge Kickoff
PDF
Understanding NFT Marketplace Development_ Trends and Innovations.pdf
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Jenkins: An open-source automation server powering CI/CD Automation
PDF
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
Which alternative to Crystal Reports is best for small or large businesses.pdf
How a Careem Clone App Allows You to Compete with Large Mobility Brands
AI in Product Development-omnex systems
Best Practices for Rolling Out Competency Management Software.pdf
CRUISE TICKETING SYSTEM | CRUISE RESERVATION SOFTWARE
Become an Agentblazer Champion Challenge
Presentation of Computer CLASS 2 .pptx
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
ManageIQ - Sprint 268 Review - Slide Deck
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
The Five Best AI Cover Tools in 2025.docx
Become an Agentblazer Champion Challenge Kickoff
Understanding NFT Marketplace Development_ Trends and Innovations.pdf
Online Work Permit System for Fast Permit Processing
How Creative Agencies Leverage Project Management Software.pdf
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Jenkins: An open-source automation server powering CI/CD Automation
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...

Session vii(java scriptbasics)

  • 2.  JavaScript is a programming language designed for Web pages that describes data and procedures in terms of objects, methods, and properties, rather than variables, routines, and statements.  Unlike HTML, JavaScript is case sensitive. JavaScript is plain text and when created in a text editor needs to be saved as a text (ASCII) file.
  • 3.  Newer editions of full featured WYSIWYG HTML editors support some Java Scripting, and often enable coding in their page source windows.  If you begin doing JavaScript by cutting and pasting you may often need to modify a few parts of the scripts, such as names of objects. Many JavaScript's are available on the WWW, and links to some popular JavaScript sites are provided below.
  • 4.  A team of Netscape and Sun Microsystems developers originally created JavaScript.  In 1998 the European Computer Manfacturers Association (ECMA) announced the adoption of a standard Internet scripting language based on JavaScript 1.1 that resolved the incompatibilities that existed in scripting between various browser implementations. Microsoft, Netscape,
  • 5.  and other browser companies agreed to follow the specification. The standard is called ECMAScript, though the common name, JavaScript, has persisted. The most recent version of JavaScript is 1.3 (ECMA- 262).
  • 6.  Version 1.3 requires Netscape 4.06 or  newer and Microsoft Internet Explorer (IE) 4.0 or newer.  IE actually uses JScript, a modified version of JavaScript that does not support all JavaScript commands.  I therefore recommend testing your pages, and using a Netscape browser when viewing Web pages with JavaScripting.
  • 7.  JavaScript can enhance the dynamics and interactive features of Web pages by enabling calculations, checking forms, writing interactive games, adding special effects, customizing graphics selections, data binding, and more. JavaScript is an interpreted language that runs in the user's browser
  • 8.  . JavaScript code works on any computer platform with a JavaScript capable browser, such as Navigator 2.0 or later,  or Microsoft Internet Explorer 3.0 or later. JavaScript capable browsers may allow disabling JavaScript in their preferences. JavaScript is easier to use than are programming languages.
  • 9.  With JavaScript, developers do not need to compile a program or work with a developer's kit. Also, the many JavaScripts available on the Internet can easily be modified and adapted to your own pages.
  • 10. JavaScript programming uses specialized terminology. ◦ Dot Syntax ◦ Objects. ◦ Properties ◦ Methods ◦ Events ◦ Functions ◦ Variables ◦ Expressions ◦ Operators
  • 11.  . Actions by page users trigger event handler commands in the JavaScript. The program will then perform whatever commands are assigned to the event
  • 12.  . Common event handlers are listed in the following table. Event Handler Action onAbort The user stopped loading a page onBlur The user moves from an object onChange The user changed an object onClick The user mouse-clicked an object onError An error occurred in the script
  • 13. Event Handler Action onMouseover The cursor has moved over the object onMouseout The cursor has moved off the object onSelect The user selected the object onSubmit The user submitted a form onUnload The user leaves the window onFocus The user activates an object onLoad The object has been loaded
  • 14.  JavaScript scripts can be embedded in an HTML page or can reside in a separate page.  JavaScript is often placed in the <head> section of the HTML document, but can also be placed in the <body>.  JavaScript object attributes can also be placed in HTML element tags. You can use JavaScript in an HTML document in the following ways:
  • 15.  As statements and functions within <script> and </script> tags.  By specifying a file as the JavaScript source using the <src> attribute of the <script> element.  By specifying a JavaScript expression as the value of an HTML attribute and as event handlers within certain other HTML tags.
  • 16.  The first method places the JavaScript between the <script> and </script> tags. When specifying a script only the tags <script> and </script> are essential.  It is recommendable to specify the script language as an attribute of the script element. Browsers currently assume JavaScript, but other programming languages could become popular in the future.
  • 17.  The standard to open scripting is <script language="JavaScript">.  The script language attribute can also specify the version of JavaScript.  It is also recommendable to specify the MIME type of the script, to denote to the browser that the script is plain text. This is accomplished with the attribute type="text/javascript".
  • 18.  The following example script redirects the browser to a page, named javascript.html. The object is window, the variable property is location, and the value equals the specified HTML file.  <script language="javascript1.2" type="text/javascript"> <!-- Begin hiding script window.location="javascript.html" // End hiding script--> </script>
  • 19.  In the following examples I do not include the <script>and </script> tags,  HTML tags or comment lines. These examples are employed using the methods described above.
  • 20.  The first example is a method for displaying text in a Web page.  The syntax for this method can also be writeIn, a method that attaches a break to each line of text. 
  • 21.  document.write("This is where you place the text that will appear in the Web page.")  The write method also permits use of HTML tags within the parenthesis, as seen below.  document.write("<b>Hello World.</b>")  The writeIn method should be used with preformatted text.
  • 22.  var month = April; var date = fifteenth;  document.write("Remember, your taxes are due on " + month + date);