SlideShare a Scribd company logo
11
Tutorial 1Tutorial 1
Introduction toIntroduction to
JavaScriptJavaScript
Section A – Programming, HTML,Section A – Programming, HTML,
and JavaScriptand JavaScript
22
Tutorial 1A TopicsTutorial 1A Topics
 Section A – Programming, HTML, andSection A – Programming, HTML, and
JavaScriptJavaScript
• About the World Wide WebAbout the World Wide Web
• Uses of JavaScriptUses of JavaScript
• About Hypertext Markup LanguageAbout Hypertext Markup Language
• How to creating an HTML documentHow to creating an HTML document
• About the JavaScript programming languageAbout the JavaScript programming language
• About logic and debuggingAbout logic and debugging
33
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The World Wide WebThe World Wide Web
• Created in 1989Created in 1989
 European Laboratory for Particle PhysicsEuropean Laboratory for Particle Physics
(Geneva Switzerland)(Geneva Switzerland)
• PurposePurpose
 Provide an easy way to access cross-Provide an easy way to access cross-
referenced documents that exist on thereferenced documents that exist on the
internetinternet
44
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The World Wide WebThe World Wide Web
• Hypertext linksHypertext links
 Contain reference to locate and open specificContain reference to locate and open specific
documentsdocuments
• Hypertext Markup Language (HTML)Hypertext Markup Language (HTML)
 Language used to design web pagesLanguage used to design web pages
(documents)(documents)
• Web BrowserWeb Browser
 Program that displays HTML documentsProgram that displays HTML documents
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
55
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The World Wide WebThe World Wide Web
• Uniform Resource Locator (URL)Uniform Resource Locator (URL)
 A type of Uniform Resource Identifier (URI)A type of Uniform Resource Identifier (URI)
• Identifies names and addresses on the WWWIdentifies names and addresses on the WWW
 A unique identifier for a web documentA unique identifier for a web document
• e.g., a telephone number or mailing addresse.g., a telephone number or mailing address
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
66
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The World Wide WebThe World Wide Web
• Uniform Resource Locator (URL)Uniform Resource Locator (URL)
 Consists of 4 parts:Consists of 4 parts:
• ProtocolProtocol →→ Hyper Text Transfer Protocol (HTTP)Hyper Text Transfer Protocol (HTTP)
• Domain NameDomain Name →→ or Internet Protocol (IP) addressor Internet Protocol (IP) address
• DirectoryDirectory
• FilenameFilename
 Specific document filenameSpecific document filename
 index.(s)htm(l) or default.(s)htm(l)index.(s)htm(l) or default.(s)htm(l)
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
77
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
88
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 JavaScript’s role on the WebJavaScript’s role on the Web
• HTMLHTML
 PurposePurpose →→ tell the browser how a documenttell the browser how a document
should appearshould appear
 StaticStatic →→ can view or print (no interaction)can view or print (no interaction)
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
99
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 JavaScript’s role on the WebJavaScript’s role on the Web
• JavaScript Programming LanguageJavaScript Programming Language
 Developed by Netscape for use in NavigatorDeveloped by Netscape for use in Navigator
Web BrowsersWeb Browsers
 PurposePurpose →→ make web pages (documents)make web pages (documents)
more dynamic and interactivemore dynamic and interactive
• Change contents of document, provide forms andChange contents of document, provide forms and
controls, animation, control web browser window,controls, animation, control web browser window,
etc.etc.
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1010
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1111
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1212
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1313
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Hypertext Markup LanguageHypertext Markup Language
• HTML DocumentHTML Document
 Text document that contains:Text document that contains:
• TagsTags →→ formatting instructionsformatting instructions
• Text to be displayedText to be displayed
 Document isDocument is parsedparsed oror renderedrendered by browserby browser
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1414
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Hypertext Markup LanguageHypertext Markup Language
• HTML DocumentHTML Document
 TagsTags
• Enclosed in brackets <tag>Enclosed in brackets <tag>
• Generally consist of:Generally consist of:
 Opening tags <tag>Opening tags <tag>
 Closing tags </tag>Closing tags </tag>
• Text contained between the opening and closingText contained between the opening and closing
tags are formatted according to tag instructionstags are formatted according to tag instructions
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1515
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Hypertext Markup LanguageHypertext Markup Language
• HTML DocumentHTML Document
 TagsTags
• All HTML documents begin with <html> tag andAll HTML documents begin with <html> tag and
end with </html>end with </html>
• HTML isHTML is notnot case sensitivecase sensitive
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1616
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Hypertext Markup LanguageHypertext Markup Language
• HTML DocumentHTML Document
 Tag AttributesTag Attributes
• Used to configure tagsUsed to configure tags
• Placed before closing bracket of opening tagPlaced before closing bracket of opening tag
 <tag attribute=“value”>some text</tag><tag attribute=“value”>some text</tag>
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1717
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1818
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
1919
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2020
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Hypertext Markup LanguageHypertext Markup Language
• HTML DocumentHTML Document
 Web browser only acknowledges text andWeb browser only acknowledges text and
valid tagsvalid tags
 Web browser ignores non-printingWeb browser ignores non-printing
characterscharacters
• Spaces, tabs, carriage returnsSpaces, tabs, carriage returns
 Must use valid tags or special characterMust use valid tags or special character
codes to accomplish this:codes to accomplish this:
• Non-breaking spaceNon-breaking space →→ &nbsp;&nbsp;
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2121
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2222
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2323
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Creating an HTML DocumentCreating an HTML Document
• Text editor (text)Text editor (text)
 Notepad, WordPadNotepad, WordPad
• Word Processor (that can create textWord Processor (that can create text
files)files)
 WordWord
• HTML Editor (WYSIWYG)HTML Editor (WYSIWYG)
 FrontPage, PageMillFrontPage, PageMill
• HTML Converters (WYSIWYG)HTML Converters (WYSIWYG)
 Word, PowerPointWord, PowerPoint
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2424
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2525
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The JavaScript ProgrammingThe JavaScript Programming
LanguageLanguage
• Scripting LanguagesScripting Languages
 Executed by an interpreter contained withinExecuted by an interpreter contained within
the web browser (scripting host)the web browser (scripting host)
 Interpreter uses a scripting engineInterpreter uses a scripting engine
• Converts code to executable format each time itConverts code to executable format each time it
runsruns
• Converted when browser loads web documentConverted when browser loads web document
2626
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The JavaScript ProgrammingThe JavaScript Programming
LanguageLanguage
• JavaScriptJavaScript
 Originally called LiveScript when introducedOriginally called LiveScript when introduced
in Netscape Navigatorin Netscape Navigator
 In Navigator 2.0, name changed toIn Navigator 2.0, name changed to
JavaScriptJavaScript
 Current version 1.5Current version 1.5
• JScriptJScript
 MS version of JavaScriptMS version of JavaScript
• Current version 5.5Current version 5.5
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2727
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The JavaScript ProgrammingThe JavaScript Programming
LanguageLanguage
• ECMAScriptECMAScript
 International, standardized version (EditionInternational, standardized version (Edition
3)3)
 Both versions (JavaScript and JScript)Both versions (JavaScript and JScript)
conform to the standardconform to the standard
• Although both have proprietary extensionsAlthough both have proprietary extensions
 Focus of this textFocus of this text
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2828
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 The JavaScript ProgrammingThe JavaScript Programming
LanguageLanguage
• JavaScriptJavaScript
 Two formats:Two formats:
• Client-sideClient-side
 Program runs on client (browser)Program runs on client (browser)
• Server-sideServer-side
 Program runs on serverProgram runs on server
 Proprietary to web server platformProprietary to web server platform
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
2929
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
3030
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Logic and DebuggingLogic and Debugging
• SyntaxSyntax
 Rules of the languageRules of the language
• LogicLogic
 Order of execution of various parts of theOrder of execution of various parts of the
programprogram
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
3131
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Logic and DebuggingLogic and Debugging
• Syntax errorSyntax error
 Misuse of syntaxMisuse of syntax
• e.g., typinge.g., typing ferfer instead ofinstead of forfor
• Logic errorsLogic errors
 Unintended operation of programUnintended operation of program
• e.g., Infinite loope.g., Infinite loop
JavaScript Tutorial 1 -JavaScript Tutorial 1 -
Introduction to JavaScriptIntroduction to JavaScript
3232
Programming, HTML, andProgramming, HTML, and
JavaScriptJavaScript
 Logic and DebuggingLogic and Debugging
• DebuggingDebugging
 Tracing and resolving errors in a programTracing and resolving errors in a program
 Coined by Admiral Grace HopperCoined by Admiral Grace Hopper
• Moth short-circuited a relayMoth short-circuited a relay
 ““bug” in the systembug” in the system
• Removed itRemoved it →→ system “debugged”system “debugged”
 NotNot an exact sciencean exact science

More Related Content

Similar to Introduction To Javascript_Vibrant Technologies & Computers (20)

PPT
introduction to javascript
Kumar
 
PPT
Prelims Coverage for Int 213
Jeph Pedrigal
 
PPSX
HTML & JAVA Script
Nitesh Gupta
 
PPTX
01_JavaScript_Advanced Level_Pratahb.pptx
prathabtwsi
 
PPT
Introduction to JavaScript
Andres Baravalle
 
PDF
Full Stack Development Course in Gurgaon
digitallynikitasharm
 
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
rattaaseifu
 
PDF
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PDF
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
ounergernan
 
PPTX
9781285852645_CH01 research and analysis of data.pptx
clement swarnappa
 
PPTX
Programming and the web for beginners
Son Nguyen
 
PPT
HTML5 Presentation
vs4vijay
 
PPT
HTML_JavaScript_Malaysia_2008 (2).ppt
Dianajeon3
 
PDF
Fii Practic Frontend BeeNear - laborator 1
BeeNear
 
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
viitalyawale
 
PDF
The Complete Internet and World Wide Web Cyber Classroom 2nd ed Edition Deitel
phakgaliwall
 
PPTX
Internet protocol second unit IIPPT.pptx
ssuser92282c
 
PPTX
Basics of html , basic of computer , html tags
spoovarasi11501
 
introduction to javascript
Kumar
 
Prelims Coverage for Int 213
Jeph Pedrigal
 
HTML & JAVA Script
Nitesh Gupta
 
01_JavaScript_Advanced Level_Pratahb.pptx
prathabtwsi
 
Introduction to JavaScript
Andres Baravalle
 
Full Stack Development Course in Gurgaon
digitallynikitasharm
 
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
rattaaseifu
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
ounergernan
 
9781285852645_CH01 research and analysis of data.pptx
clement swarnappa
 
Programming and the web for beginners
Son Nguyen
 
HTML5 Presentation
vs4vijay
 
HTML_JavaScript_Malaysia_2008 (2).ppt
Dianajeon3
 
Fii Practic Frontend BeeNear - laborator 1
BeeNear
 
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
viitalyawale
 
The Complete Internet and World Wide Web Cyber Classroom 2nd ed Edition Deitel
phakgaliwall
 
Internet protocol second unit IIPPT.pptx
ssuser92282c
 
Basics of html , basic of computer , html tags
spoovarasi11501
 

More from Vibrant Technologies & Computers (20)

PPT
Buisness analyst business analysis overview ppt 5
Vibrant Technologies & Computers
 
PPT
SQL Introduction to displaying data from multiple tables
Vibrant Technologies & Computers
 
PPT
SQL- Introduction to MySQL
Vibrant Technologies & Computers
 
PPT
SQL- Introduction to SQL database
Vibrant Technologies & Computers
 
PPT
ITIL - introduction to ITIL
Vibrant Technologies & Computers
 
PPT
Salesforce - Introduction to Security & Access
Vibrant Technologies & Computers
 
PPT
Data ware housing- Introduction to olap .
Vibrant Technologies & Computers
 
PPT
Data ware housing - Introduction to data ware housing process.
Vibrant Technologies & Computers
 
PPT
Data ware housing- Introduction to data ware housing
Vibrant Technologies & Computers
 
PPT
Salesforce - classification of cloud computing
Vibrant Technologies & Computers
 
PPT
Salesforce - cloud computing fundamental
Vibrant Technologies & Computers
 
PPT
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
PPT
SQL- Introduction to advanced sql concepts
Vibrant Technologies & Computers
 
PPT
SQL Inteoduction to SQL manipulating of data
Vibrant Technologies & Computers
 
PPT
SQL- Introduction to SQL Set Operations
Vibrant Technologies & Computers
 
PPT
Sas - Introduction to designing the data mart
Vibrant Technologies & Computers
 
PPT
Sas - Introduction to working under change management
Vibrant Technologies & Computers
 
PPT
SAS - overview of SAS
Vibrant Technologies & Computers
 
PPT
Teradata - Architecture of Teradata
Vibrant Technologies & Computers
 
PPT
Teradata - Restoring Data
Vibrant Technologies & Computers
 
Buisness analyst business analysis overview ppt 5
Vibrant Technologies & Computers
 
SQL Introduction to displaying data from multiple tables
Vibrant Technologies & Computers
 
SQL- Introduction to MySQL
Vibrant Technologies & Computers
 
SQL- Introduction to SQL database
Vibrant Technologies & Computers
 
ITIL - introduction to ITIL
Vibrant Technologies & Computers
 
Salesforce - Introduction to Security & Access
Vibrant Technologies & Computers
 
Data ware housing- Introduction to olap .
Vibrant Technologies & Computers
 
Data ware housing - Introduction to data ware housing process.
Vibrant Technologies & Computers
 
Data ware housing- Introduction to data ware housing
Vibrant Technologies & Computers
 
Salesforce - classification of cloud computing
Vibrant Technologies & Computers
 
Salesforce - cloud computing fundamental
Vibrant Technologies & Computers
 
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
SQL- Introduction to advanced sql concepts
Vibrant Technologies & Computers
 
SQL Inteoduction to SQL manipulating of data
Vibrant Technologies & Computers
 
SQL- Introduction to SQL Set Operations
Vibrant Technologies & Computers
 
Sas - Introduction to designing the data mart
Vibrant Technologies & Computers
 
Sas - Introduction to working under change management
Vibrant Technologies & Computers
 
SAS - overview of SAS
Vibrant Technologies & Computers
 
Teradata - Architecture of Teradata
Vibrant Technologies & Computers
 
Teradata - Restoring Data
Vibrant Technologies & Computers
 
Ad

Recently uploaded (20)

PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Ad

Introduction To Javascript_Vibrant Technologies & Computers

  • 1. 11 Tutorial 1Tutorial 1 Introduction toIntroduction to JavaScriptJavaScript Section A – Programming, HTML,Section A – Programming, HTML, and JavaScriptand JavaScript
  • 2. 22 Tutorial 1A TopicsTutorial 1A Topics  Section A – Programming, HTML, andSection A – Programming, HTML, and JavaScriptJavaScript • About the World Wide WebAbout the World Wide Web • Uses of JavaScriptUses of JavaScript • About Hypertext Markup LanguageAbout Hypertext Markup Language • How to creating an HTML documentHow to creating an HTML document • About the JavaScript programming languageAbout the JavaScript programming language • About logic and debuggingAbout logic and debugging
  • 3. 33 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The World Wide WebThe World Wide Web • Created in 1989Created in 1989  European Laboratory for Particle PhysicsEuropean Laboratory for Particle Physics (Geneva Switzerland)(Geneva Switzerland) • PurposePurpose  Provide an easy way to access cross-Provide an easy way to access cross- referenced documents that exist on thereferenced documents that exist on the internetinternet
  • 4. 44 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The World Wide WebThe World Wide Web • Hypertext linksHypertext links  Contain reference to locate and open specificContain reference to locate and open specific documentsdocuments • Hypertext Markup Language (HTML)Hypertext Markup Language (HTML)  Language used to design web pagesLanguage used to design web pages (documents)(documents) • Web BrowserWeb Browser  Program that displays HTML documentsProgram that displays HTML documents
  • 5. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 55 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The World Wide WebThe World Wide Web • Uniform Resource Locator (URL)Uniform Resource Locator (URL)  A type of Uniform Resource Identifier (URI)A type of Uniform Resource Identifier (URI) • Identifies names and addresses on the WWWIdentifies names and addresses on the WWW  A unique identifier for a web documentA unique identifier for a web document • e.g., a telephone number or mailing addresse.g., a telephone number or mailing address
  • 6. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 66 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The World Wide WebThe World Wide Web • Uniform Resource Locator (URL)Uniform Resource Locator (URL)  Consists of 4 parts:Consists of 4 parts: • ProtocolProtocol →→ Hyper Text Transfer Protocol (HTTP)Hyper Text Transfer Protocol (HTTP) • Domain NameDomain Name →→ or Internet Protocol (IP) addressor Internet Protocol (IP) address • DirectoryDirectory • FilenameFilename  Specific document filenameSpecific document filename  index.(s)htm(l) or default.(s)htm(l)index.(s)htm(l) or default.(s)htm(l)
  • 7. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 77
  • 8. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 88 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  JavaScript’s role on the WebJavaScript’s role on the Web • HTMLHTML  PurposePurpose →→ tell the browser how a documenttell the browser how a document should appearshould appear  StaticStatic →→ can view or print (no interaction)can view or print (no interaction)
  • 9. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 99 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  JavaScript’s role on the WebJavaScript’s role on the Web • JavaScript Programming LanguageJavaScript Programming Language  Developed by Netscape for use in NavigatorDeveloped by Netscape for use in Navigator Web BrowsersWeb Browsers  PurposePurpose →→ make web pages (documents)make web pages (documents) more dynamic and interactivemore dynamic and interactive • Change contents of document, provide forms andChange contents of document, provide forms and controls, animation, control web browser window,controls, animation, control web browser window, etc.etc.
  • 10. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1010
  • 11. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1111
  • 12. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1212
  • 13. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1313 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Hypertext Markup LanguageHypertext Markup Language • HTML DocumentHTML Document  Text document that contains:Text document that contains: • TagsTags →→ formatting instructionsformatting instructions • Text to be displayedText to be displayed  Document isDocument is parsedparsed oror renderedrendered by browserby browser
  • 14. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1414 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Hypertext Markup LanguageHypertext Markup Language • HTML DocumentHTML Document  TagsTags • Enclosed in brackets <tag>Enclosed in brackets <tag> • Generally consist of:Generally consist of:  Opening tags <tag>Opening tags <tag>  Closing tags </tag>Closing tags </tag> • Text contained between the opening and closingText contained between the opening and closing tags are formatted according to tag instructionstags are formatted according to tag instructions
  • 15. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1515 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Hypertext Markup LanguageHypertext Markup Language • HTML DocumentHTML Document  TagsTags • All HTML documents begin with <html> tag andAll HTML documents begin with <html> tag and end with </html>end with </html> • HTML isHTML is notnot case sensitivecase sensitive
  • 16. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1616 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Hypertext Markup LanguageHypertext Markup Language • HTML DocumentHTML Document  Tag AttributesTag Attributes • Used to configure tagsUsed to configure tags • Placed before closing bracket of opening tagPlaced before closing bracket of opening tag  <tag attribute=“value”>some text</tag><tag attribute=“value”>some text</tag>
  • 17. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1717
  • 18. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1818
  • 19. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 1919
  • 20. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2020 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Hypertext Markup LanguageHypertext Markup Language • HTML DocumentHTML Document  Web browser only acknowledges text andWeb browser only acknowledges text and valid tagsvalid tags  Web browser ignores non-printingWeb browser ignores non-printing characterscharacters • Spaces, tabs, carriage returnsSpaces, tabs, carriage returns  Must use valid tags or special characterMust use valid tags or special character codes to accomplish this:codes to accomplish this: • Non-breaking spaceNon-breaking space →→ &nbsp;&nbsp;
  • 21. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2121
  • 22. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2222
  • 23. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2323 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Creating an HTML DocumentCreating an HTML Document • Text editor (text)Text editor (text)  Notepad, WordPadNotepad, WordPad • Word Processor (that can create textWord Processor (that can create text files)files)  WordWord • HTML Editor (WYSIWYG)HTML Editor (WYSIWYG)  FrontPage, PageMillFrontPage, PageMill • HTML Converters (WYSIWYG)HTML Converters (WYSIWYG)  Word, PowerPointWord, PowerPoint
  • 24. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2424
  • 25. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2525 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The JavaScript ProgrammingThe JavaScript Programming LanguageLanguage • Scripting LanguagesScripting Languages  Executed by an interpreter contained withinExecuted by an interpreter contained within the web browser (scripting host)the web browser (scripting host)  Interpreter uses a scripting engineInterpreter uses a scripting engine • Converts code to executable format each time itConverts code to executable format each time it runsruns • Converted when browser loads web documentConverted when browser loads web document
  • 26. 2626 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The JavaScript ProgrammingThe JavaScript Programming LanguageLanguage • JavaScriptJavaScript  Originally called LiveScript when introducedOriginally called LiveScript when introduced in Netscape Navigatorin Netscape Navigator  In Navigator 2.0, name changed toIn Navigator 2.0, name changed to JavaScriptJavaScript  Current version 1.5Current version 1.5 • JScriptJScript  MS version of JavaScriptMS version of JavaScript • Current version 5.5Current version 5.5
  • 27. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2727 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The JavaScript ProgrammingThe JavaScript Programming LanguageLanguage • ECMAScriptECMAScript  International, standardized version (EditionInternational, standardized version (Edition 3)3)  Both versions (JavaScript and JScript)Both versions (JavaScript and JScript) conform to the standardconform to the standard • Although both have proprietary extensionsAlthough both have proprietary extensions  Focus of this textFocus of this text
  • 28. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2828 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  The JavaScript ProgrammingThe JavaScript Programming LanguageLanguage • JavaScriptJavaScript  Two formats:Two formats: • Client-sideClient-side  Program runs on client (browser)Program runs on client (browser) • Server-sideServer-side  Program runs on serverProgram runs on server  Proprietary to web server platformProprietary to web server platform
  • 29. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 2929
  • 30. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 3030 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Logic and DebuggingLogic and Debugging • SyntaxSyntax  Rules of the languageRules of the language • LogicLogic  Order of execution of various parts of theOrder of execution of various parts of the programprogram
  • 31. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 3131 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Logic and DebuggingLogic and Debugging • Syntax errorSyntax error  Misuse of syntaxMisuse of syntax • e.g., typinge.g., typing ferfer instead ofinstead of forfor • Logic errorsLogic errors  Unintended operation of programUnintended operation of program • e.g., Infinite loope.g., Infinite loop
  • 32. JavaScript Tutorial 1 -JavaScript Tutorial 1 - Introduction to JavaScriptIntroduction to JavaScript 3232 Programming, HTML, andProgramming, HTML, and JavaScriptJavaScript  Logic and DebuggingLogic and Debugging • DebuggingDebugging  Tracing and resolving errors in a programTracing and resolving errors in a program  Coined by Admiral Grace HopperCoined by Admiral Grace Hopper • Moth short-circuited a relayMoth short-circuited a relay  ““bug” in the systembug” in the system • Removed itRemoved it →→ system “debugged”system “debugged”  NotNot an exact sciencean exact science