SlideShare a Scribd company logo
Outline
IS400: Development of Business Applications on the Internet
Fall 2004
Instructor: Dr. Boris Jukic
JavaScript: Introduction
to Scripting
Topics Covered
 Writing simple JavaScript programs.
 Using input and output statements
 Basic memory concepts.
 Arithmetic operators.
 Decision-making statements.
 Relational and equality operators.
Introduction
 JavaScript scripting language
– Client-side scripting enhances functionality and
appearance
 Makes pages more dynamic and interactive
 Pages can produce immediate response without
contacting a server
 Customization is possible on the basis of users’ explicit
and implicit input
 Browser has to have a built-in (JavaScript) interpreter
– Foundation for complex server-side scripting
JavaScript: Object-Based Language
 There are three object categories in JavaScript:
Native Objects, Host Objects, and User-Defined
Objects.
– Native objects: defined by JavaScript.
 String, Number, Array, Image, Date, Math, etc.
– Host objects : supplied and always available to JavaScript
by the browser environment.
 window, document, forms, etc.
– User-defined objects : defined by the author/programmer
 Initially, we will use host objects created by the
browser and their methods and properties
Scripting
 Two approaches to client side scripting:
– Inline scripting
 Written in the <body> section of a document
– JavaScript code embedded in the <head> section
Scripting
 <script> tag
 Indicate that the text is part of a script
 type attribute
– Specifies the type of file and the scripting language use:
 Value: “text/javascript”
– IE and Netscape use JavaScript as default scripting language
 writeln method of the document object
– Write a line in the document and position the cursor in the next
line
– Does not affect the actual rendering of the HTML document
 What is being written by JavaScript is the set of html
instructions that in turn determine the rendering of the html
document
Outline
welcome.html
(1 of 1)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.1: welcome.html -->
6 <!-- Displaying a line of text -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>A First Program in JavaScript</title>
11
12 <script type = "text/javascript">
13 <!--
14 document.writeln(
15 "<h1>Welcome to JavaScript Programming!</h1>" );
16 // -->
17 </script>
18
19 </head><body></body>
20 </html>
HTML comment tags will
result in skipping of the script
by those browsers
that do not support scripting
Outline
welcome2.html
(1 of 1)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.2: welcome2.html -->
6 <!-- Printing a Line with Multiple Statements -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Printing a Line with Multiple Statements</title>
11
12 <script type = "text/javascript">
13 <!--
14 document.write( "<h1 style = "color: magenta">" );
15 document.write( "Welcome to JavaScript " +
16 "Programming!</h1>" );
17 // -->
18 </script>
19
20 </head><body></body>
21 </html>
Escape character in combination
with quotation mark: ” will result
in insertion of a quotation mark in
the string that is actually written
by JavaScript
Outline
welcome3.html
1 of 1
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.3: welcome3.html -->
6 <!-- Printing Multiple Lines -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head><title>Printing Multiple Lines</title>
10
11 <script type = "text/javascript">
12 <!--
13 document.writeln( "<h1>Welcome to<br />JavaScript" +
14 "<br />Programming!</h1>" );
15 // -->
16 </script>
17
18 </head><body></body>
19 </html>
New line of the html document
in a browser is determined by an
html <br /> element
Outline
welcome3.html
1 of 1
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.3: welcome3.html -->
6 <!-- Printing Multiple Lines -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head><title>Printing Multiple Lines</title>
10
11 <script type = "text/javascript">
12 <!--
13 document.writeln( "<h1>Welcome to<br />JavaScript" +
14 "<br />Programming!</h1>" );
15 // -->
16 </script>
17
18 </head><body></body>
19 </html>
New line of the html document
in a browser is determined by an
html <br /> element

More Related Content

DOCX
Introduction of javascript
syeda zoya mehdi
 
PPT
Java Script
siddaram
 
PPTX
Java Script
husbancom
 
PPTX
Empowerment Technologies Lecture 11 (Philippines SHS)
John Bosco Javellana, MAEd.
 
PPT
Java script
umesh patil
 
PPT
Java script
umesh patil
 
PPT
JavaScript Missing Manual, Ch. 1
Gene Babon
 
PPT
JavaScript - Part-1
Jainul Musani
 
Introduction of javascript
syeda zoya mehdi
 
Java Script
siddaram
 
Java Script
husbancom
 
Empowerment Technologies Lecture 11 (Philippines SHS)
John Bosco Javellana, MAEd.
 
Java script
umesh patil
 
Java script
umesh patil
 
JavaScript Missing Manual, Ch. 1
Gene Babon
 
JavaScript - Part-1
Jainul Musani
 

What's hot (20)

PPT
Java script
ITz_1
 
PPT
Scripting languages
teach4uin
 
PPT
Web Designing
Ram Dutt Shukla
 
PPT
JavaScript Introduction
Jainul Musani
 
PPT
Java script
Fajar Baskoro
 
PPTX
Introduction to Java Script
Vijay Kumar Verma
 
PPTX
Java script writing javascript
Jesus Obenita Jr.
 
PPTX
Session 3 Java Script
Muhammad Hesham
 
PPT
HTML Introduction
Jainul Musani
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PPTX
JavaScript with Syntax & Implementation
Soumen Santra
 
PPT
DHTML - Dynamic HTML
Reem Alattas
 
PPT
Java script programs
ITz_1
 
PPTX
Introduction to java_script
Basavaraj Hampali
 
PPTX
Java Script
Dr. SURBHI SAROHA
 
PDF
Introduction to html & css
sesharao puvvada
 
PPTX
Fundamentals of Web building
RC Morales
 
PPT
Web Application Introduction
shaojung
 
Java script
ITz_1
 
Scripting languages
teach4uin
 
Web Designing
Ram Dutt Shukla
 
JavaScript Introduction
Jainul Musani
 
Java script
Fajar Baskoro
 
Introduction to Java Script
Vijay Kumar Verma
 
Java script writing javascript
Jesus Obenita Jr.
 
Session 3 Java Script
Muhammad Hesham
 
HTML Introduction
Jainul Musani
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
JavaScript with Syntax & Implementation
Soumen Santra
 
DHTML - Dynamic HTML
Reem Alattas
 
Java script programs
ITz_1
 
Introduction to java_script
Basavaraj Hampali
 
Java Script
Dr. SURBHI SAROHA
 
Introduction to html & css
sesharao puvvada
 
Fundamentals of Web building
RC Morales
 
Web Application Introduction
shaojung
 
Ad

Similar to Test2 (20)

PPT
Java script
fahhadalghamdi
 
PPT
Introduction to java script Lecture 4.ppt
dejen6
 
PPT
Javascript for beggineers Lecture 4 (1).ppt
testvarun21
 
PPT
Introduction to Scripting programming Language.
ssuser2712bb
 
PPT
JS-Lecture Lecture PPT contains Control Structures DOM
SripathiRavi1
 
PPT
Lecture 4.javascriptpractcieandtheoryppt
makohaalex22
 
PPT
Java script
fahhadalghamdi
 
PPTX
JavaScripts & jQuery
Asanka Indrajith
 
PPTX
CSC PPT 12.pptx
DrRavneetSingh
 
PPTX
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
PPTX
Final Java-script.pptx
AlkanthiSomesh
 
PDF
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PDF
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
DOCX
Javascript tutorial
Abhishek Kesharwani
 
PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
DOC
Basics java scripts
ch samaram
 
PPT
JAVA SCRIPT
Go4Guru
 
PPTX
Java script
Sukrit Gupta
 
PPT
JavaScript
Reem Alattas
 
Java script
fahhadalghamdi
 
Introduction to java script Lecture 4.ppt
dejen6
 
Javascript for beggineers Lecture 4 (1).ppt
testvarun21
 
Introduction to Scripting programming Language.
ssuser2712bb
 
JS-Lecture Lecture PPT contains Control Structures DOM
SripathiRavi1
 
Lecture 4.javascriptpractcieandtheoryppt
makohaalex22
 
Java script
fahhadalghamdi
 
JavaScripts & jQuery
Asanka Indrajith
 
CSC PPT 12.pptx
DrRavneetSingh
 
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
Final Java-script.pptx
AlkanthiSomesh
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
Javascript tutorial
Abhishek Kesharwani
 
Basic JavaScript Tutorial
DHTMLExtreme
 
Basics java scripts
ch samaram
 
JAVA SCRIPT
Go4Guru
 
Java script
Sukrit Gupta
 
JavaScript
Reem Alattas
 
Ad

Recently uploaded (20)

PDF
LLLLLLLLLLLLLLLLLLLLCABUTAN UNDIAN PELANCARAN ROKET.pdf
ABKARIMBINABDULRAHMA
 
PDF
Zero no Tsukaima 2 - Albion of the Wind.pdf
WaldeckFlugelWallens
 
PPTX
design for presentation purpose can used
vishveshvarvms
 
PPTX
Escalator_21bar064,070,073aeqweqeqe.pptx
Aaravpatel25
 
PDF
Zero no Tsukaima 1 - Zero_s Familiar.pdf
WaldeckFlugelWallens
 
DOCX
This is a security test for Inspectiv test
Firsts Lasts
 
PDF
Why Should You Hire a Video Production Studio in 2025?
GXYZ Inc
 
PPTX
UCSP Quarter 1 Week 4 Powerpoint Presentation
EmyMaquiling1
 
PPTX
Certificate of Participation.pptx phase Pana.pptx
GalintaFidel
 
PDF
Your Love Story, Beautifully Told by FliqaIndia’s Creative Experts
sandeep239227
 
PDF
Between Porchlight and Citylight: The Joseph Kim Journey
Joseph Kim Nolensville Tennessee
 
PPTX
ALPHAWEBSITE122wdawdwawfawfwafwfawfwa.pptx
panjibagus296
 
PDF
📚Student and education importance......
kasimnagori121
 
DOCX
Nutrition about ICT AND TLE.09111001991981
CharmicahOmayan3
 
PPTX
奎斯特大学文凭办理|办理QUC毕业证学位证书2025年新版学位证书影本
1cz3lou8
 
PPTX
ENGLISH 6 WEEK 6 DAY 2.pptxLFLLLLLLLLLLLLLLLLLLLLLLLLLL
DitaSIdnay
 
PPTX
Human Efficiencknkjnhjbnhjbhjhjbnljy.pptx
hanhocpt13
 
PDF
PowerPoint Presentation -- Khai Y -- 9ca7f3602ac1344b9321b19ff99e177d -- Anna...
Adeel452922
 
PPT
Wayne Thiebaud Not Pop Art Presentation ppt
brwnidjessicaleigh
 
PPTX
Q1_Music and Arts_Week 3-4 [Autosaved].pptx
MelissaJeanBayobay1
 
LLLLLLLLLLLLLLLLLLLLCABUTAN UNDIAN PELANCARAN ROKET.pdf
ABKARIMBINABDULRAHMA
 
Zero no Tsukaima 2 - Albion of the Wind.pdf
WaldeckFlugelWallens
 
design for presentation purpose can used
vishveshvarvms
 
Escalator_21bar064,070,073aeqweqeqe.pptx
Aaravpatel25
 
Zero no Tsukaima 1 - Zero_s Familiar.pdf
WaldeckFlugelWallens
 
This is a security test for Inspectiv test
Firsts Lasts
 
Why Should You Hire a Video Production Studio in 2025?
GXYZ Inc
 
UCSP Quarter 1 Week 4 Powerpoint Presentation
EmyMaquiling1
 
Certificate of Participation.pptx phase Pana.pptx
GalintaFidel
 
Your Love Story, Beautifully Told by FliqaIndia’s Creative Experts
sandeep239227
 
Between Porchlight and Citylight: The Joseph Kim Journey
Joseph Kim Nolensville Tennessee
 
ALPHAWEBSITE122wdawdwawfawfwafwfawfwa.pptx
panjibagus296
 
📚Student and education importance......
kasimnagori121
 
Nutrition about ICT AND TLE.09111001991981
CharmicahOmayan3
 
奎斯特大学文凭办理|办理QUC毕业证学位证书2025年新版学位证书影本
1cz3lou8
 
ENGLISH 6 WEEK 6 DAY 2.pptxLFLLLLLLLLLLLLLLLLLLLLLLLLLL
DitaSIdnay
 
Human Efficiencknkjnhjbnhjbhjhjbnljy.pptx
hanhocpt13
 
PowerPoint Presentation -- Khai Y -- 9ca7f3602ac1344b9321b19ff99e177d -- Anna...
Adeel452922
 
Wayne Thiebaud Not Pop Art Presentation ppt
brwnidjessicaleigh
 
Q1_Music and Arts_Week 3-4 [Autosaved].pptx
MelissaJeanBayobay1
 

Test2

  • 1. Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting
  • 2. Topics Covered  Writing simple JavaScript programs.  Using input and output statements  Basic memory concepts.  Arithmetic operators.  Decision-making statements.  Relational and equality operators.
  • 3. Introduction  JavaScript scripting language – Client-side scripting enhances functionality and appearance  Makes pages more dynamic and interactive  Pages can produce immediate response without contacting a server  Customization is possible on the basis of users’ explicit and implicit input  Browser has to have a built-in (JavaScript) interpreter – Foundation for complex server-side scripting
  • 4. JavaScript: Object-Based Language  There are three object categories in JavaScript: Native Objects, Host Objects, and User-Defined Objects. – Native objects: defined by JavaScript.  String, Number, Array, Image, Date, Math, etc. – Host objects : supplied and always available to JavaScript by the browser environment.  window, document, forms, etc. – User-defined objects : defined by the author/programmer  Initially, we will use host objects created by the browser and their methods and properties
  • 5. Scripting  Two approaches to client side scripting: – Inline scripting  Written in the <body> section of a document – JavaScript code embedded in the <head> section
  • 6. Scripting  <script> tag  Indicate that the text is part of a script  type attribute – Specifies the type of file and the scripting language use:  Value: “text/javascript” – IE and Netscape use JavaScript as default scripting language  writeln method of the document object – Write a line in the document and position the cursor in the next line – Does not affect the actual rendering of the HTML document  What is being written by JavaScript is the set of html instructions that in turn determine the rendering of the html document
  • 7. Outline welcome.html (1 of 1) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.1: welcome.html --> 6 <!-- Displaying a line of text --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>A First Program in JavaScript</title> 11 12 <script type = "text/javascript"> 13 <!-- 14 document.writeln( 15 "<h1>Welcome to JavaScript Programming!</h1>" ); 16 // --> 17 </script> 18 19 </head><body></body> 20 </html> HTML comment tags will result in skipping of the script by those browsers that do not support scripting
  • 8. Outline welcome2.html (1 of 1) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.2: welcome2.html --> 6 <!-- Printing a Line with Multiple Statements --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Printing a Line with Multiple Statements</title> 11 12 <script type = "text/javascript"> 13 <!-- 14 document.write( "<h1 style = "color: magenta">" ); 15 document.write( "Welcome to JavaScript " + 16 "Programming!</h1>" ); 17 // --> 18 </script> 19 20 </head><body></body> 21 </html> Escape character in combination with quotation mark: ” will result in insertion of a quotation mark in the string that is actually written by JavaScript
  • 9. Outline welcome3.html 1 of 1 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.3: welcome3.html --> 6 <!-- Printing Multiple Lines --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head><title>Printing Multiple Lines</title> 10 11 <script type = "text/javascript"> 12 <!-- 13 document.writeln( "<h1>Welcome to<br />JavaScript" + 14 "<br />Programming!</h1>" ); 15 // --> 16 </script> 17 18 </head><body></body> 19 </html> New line of the html document in a browser is determined by an html <br /> element
  • 10. Outline welcome3.html 1 of 1 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.3: welcome3.html --> 6 <!-- Printing Multiple Lines --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head><title>Printing Multiple Lines</title> 10 11 <script type = "text/javascript"> 12 <!-- 13 document.writeln( "<h1>Welcome to<br />JavaScript" + 14 "<br />Programming!</h1>" ); 15 // --> 16 </script> 17 18 </head><body></body> 19 </html> New line of the html document in a browser is determined by an html <br /> element