SlideShare uma empresa Scribd logo
1 de 32
Tutorial 1
      Introduction to
        JavaScript

Section A – Programming, HTML,
         and JavaScript

         JavaScript   Tutorial 1 - Introduction to JavaScript   1
Tutorial 1A Topics
   Section A – Programming, HTML, and
    JavaScript
    •   About the World Wide Web
    •   Uses of JavaScript
    •   About Hypertext Markup Language
    •   How to creating an HTML document
    •   About the JavaScript programming language
    •   About logic and debugging



                   JavaScript           2
                                     Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   The World Wide Web
    • Created in 1989
         European Laboratory for Particle Physics
          (Geneva Switzerland)
    • Purpose
         Provide an easy way to access cross-
          referenced documents that exist on the
          internet



                   JavaScript             3
                                       Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   The World Wide Web
    • Hypertext links
         Contain reference to locate and open specific
          documents
    • Hypertext Markup Language (HTML)
         Language used to design web pages
          (documents)
    • Web Browser
         Program that displays HTML documents



                   JavaScript             4
                                       Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   The World Wide Web
    • Uniform Resource Locator (URL)
         A type of Uniform Resource Identifier (URI)
           • Identifies names and addresses on the WWW
         A unique identifier for a web document
           • e.g., a telephone number or mailing address




                    JavaScript                5
                                           Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   The World Wide Web
    • Uniform Resource Locator (URL)
         Consists of 4 parts:
           •   Protocol → Hyper Text Transfer Protocol (HTTP)
           •   Domain Name → or Internet Protocol (IP) address
           •   Directory
           •   Filename
                  Specific document filename

                  index.(s)htm(l) or default.(s)htm(l)




                      JavaScript               6
                                            Tutorial 1 - Introduction
JavaScript      7
             Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   JavaScript’s role on the Web
    • HTML
       Purpose → tell the browser how a document
        should appear
       Static → can view or print (no interaction)




                 JavaScript            8
                                    Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   JavaScript’s role on the Web
    • JavaScript Programming Language
       Developed by Netscape for use in Navigator
        Web Browsers
       Purpose → make web pages (documents)

        more dynamic and interactive
          • Change contents of document, provide forms and
            controls, animation, control web browser window,
            etc.




                   JavaScript                9
                                          Tutorial 1 - Introduction
JavaScript      10
             Tutorial 1 - Introduction
JavaScript      11
             Tutorial 1 - Introduction
JavaScript      12
             Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   Hypertext Markup Language
    • HTML Document
         Text document that contains:
           • Tags → formatting instructions
           • Text to be displayed
         Document is parsed or rendered by browser




                    JavaScript                   13
                                              Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   Hypertext Markup Language
    • HTML Document
         Tags
           • Enclosed in brackets <tag>
           • Generally consist of:
                Opening tags <tag>

                Closing tags </tag>

           • Text contained between the opening and closing
             tags are formatted according to tag instructions




                     JavaScript                14
                                            Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   Hypertext Markup Language
    • HTML Document
         Tags
           • All HTML documents begin with <html> tag and
             end with </html>
           • HTML is not case sensitive




                    JavaScript               15
                                          Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   Hypertext Markup Language
    • HTML Document
         Tag Attributes
           • Used to configure tags
           • Placed before closing bracket of opening tag
                <tag attribute=“value”>some text</tag>




                    JavaScript                16
                                           Tutorial 1 - Introduction
JavaScript      17
             Tutorial 1 - Introduction
JavaScript      18
             Tutorial 1 - Introduction
JavaScript      19
             Tutorial 1 - Introduction
Programming, HTML, and
            JavaScript
   Hypertext Markup Language
    • HTML Document
       Web browser only acknowledges text and
        valid tags
       Web browser ignores non-printing

        characters
           • Spaces, tabs, carriage returns
         Must use valid tags or special character
          codes to accomplish this:
           • Non-breaking space → &nbsp;


                     JavaScript                  20
                                              Tutorial 1 - Introduction
JavaScript      21
             Tutorial 1 - Introduction
JavaScript      22
             Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   Creating an HTML Document
    • Text editor (text)
         Notepad, WordPad
    • Word Processor (that can create text
      files)
         Word
    • HTML Editor (WYSIWYG)
         FrontPage, PageMill
    • HTML Converters (WYSIWYG)
         Word, PowerPoint

                   JavaScript      23
                                Tutorial 1 - Introduction
JavaScript      24
             Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   The JavaScript Programming
    Language
    • Scripting Languages
       Executed by an interpreter contained within
        the web browser (scripting host)
       Interpreter uses a scripting engine

          • Converts code to executable format each time it
            runs
          • Converted when browser loads web document



                   JavaScript                25
                                          Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   The JavaScript Programming
    Language
    • JavaScript
       Originally called LiveScript when introduced
        in Netscape Navigator
       In Navigator 2.0, name changed to

        JavaScript
       Current version 1.5


    • JScript
         MS version of JavaScript
           • Current version 5.5
                     JavaScript         26
                                     Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   The JavaScript Programming
    Language
    • ECMAScript
       International, standardized version (Edition
        3)
       Both versions (JavaScript and JScript)

        conform to the standard
           • Although both have proprietary extensions
         Focus of this text


                    JavaScript                27
                                           Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   The JavaScript Programming
    Language
    • JavaScript
         Two formats:
           • Client-side
                Program runs on client (browser)

           • Server-side
                Program runs on server

                Proprietary to web server platform




                     JavaScript                28
                                            Tutorial 1 - Introduction
JavaScript      29
             Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   Logic and Debugging
    • Syntax
         Rules of the language
    • Logic
         Order of execution of various parts of the
          program




                    JavaScript             30
                                        Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   Logic and Debugging
    • Syntax error
         Misuse of syntax
           • e.g., typing fer instead of for
    • Logic errors
         Unintended operation of program
           • e.g., Infinite loop




                      JavaScript                  31
                                               Tutorial 1 - Introduction
Programming, HTML, and
             JavaScript
   Logic and Debugging
    • Debugging
       Tracing and resolving errors in a program
       Coined by Admiral Grace Hopper

           • Moth short-circuited a relay
               “bug” in the system

           • Removed it → system “debugged”
         Not an exact science




                   JavaScript              32
                                        Tutorial 1 - Introduction

Mais conteúdo relacionado

Mais procurados (20)

70 536
70 53670 536
70 536
 
Generics
GenericsGenerics
Generics
 
JS - Basics
JS - BasicsJS - Basics
JS - Basics
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Web development basics (Part-4)
Web development basics (Part-4)Web development basics (Part-4)
Web development basics (Part-4)
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
 
Web-Dev Portfolio
Web-Dev PortfolioWeb-Dev Portfolio
Web-Dev Portfolio
 
Web programming
Web programmingWeb programming
Web programming
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 
Javascript Roadmap - The Basics
Javascript Roadmap - The BasicsJavascript Roadmap - The Basics
Javascript Roadmap - The Basics
 
Typescript
TypescriptTypescript
Typescript
 
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 

Semelhante a introduction to javascript

Introduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersIntroduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersVibrant Technologies & Computers
 
Introduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersIntroduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersVibrant Technologies & Computers
 
Introduction To Javascript_ Vibrant Technologies & Computers
Introduction To Javascript_ Vibrant Technologies & ComputersIntroduction To Javascript_ Vibrant Technologies & Computers
Introduction To Javascript_ Vibrant Technologies & ComputersVibrant Technologies & Computers
 
ARTDM 171, Week 2: A Brief History + Web Basics
ARTDM 171, Week 2: A Brief History + Web BasicsARTDM 171, Week 2: A Brief History + Web Basics
ARTDM 171, Week 2: A Brief History + Web BasicsGilbert Guerrero
 
Introduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML FundamentalsIntroduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML FundamentalsKalin Chernev
 
CSS Adnaved with HTML abd complete Stylesheet
CSS Adnaved with HTML abd complete StylesheetCSS Adnaved with HTML abd complete Stylesheet
CSS Adnaved with HTML abd complete StylesheetPraveenHegde20
 
javascript 1
javascript 1javascript 1
javascript 1osman do
 
Ddpz2613 topic1 introduction
Ddpz2613 topic1 introductionDdpz2613 topic1 introduction
Ddpz2613 topic1 introductionMohamad Sahiedan
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_phpJeanho Chu
 
Javascript
JavascriptJavascript
JavascriptMozxai
 
Week 8 intro to python
Week 8   intro to pythonWeek 8   intro to python
Week 8 intro to pythonbrianjihoonlee
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languagesAman Kumar
 
7 Top PHP Development Tools For PHP Coding
7 Top PHP Development Tools For PHP Coding7 Top PHP Development Tools For PHP Coding
7 Top PHP Development Tools For PHP Codingknot sync
 

Semelhante a introduction to javascript (20)

Introduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersIntroduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & Computers
 
Introduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & ComputersIntroduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & Computers
 
Introduction To Javascript_ Vibrant Technologies & Computers
Introduction To Javascript_ Vibrant Technologies & ComputersIntroduction To Javascript_ Vibrant Technologies & Computers
Introduction To Javascript_ Vibrant Technologies & Computers
 
Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Web Fundamental
Web FundamentalWeb Fundamental
Web Fundamental
 
ARTDM 171, Week 2: A Brief History + Web Basics
ARTDM 171, Week 2: A Brief History + Web BasicsARTDM 171, Week 2: A Brief History + Web Basics
ARTDM 171, Week 2: A Brief History + Web Basics
 
Introduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML FundamentalsIntroduction to Frontend Development - Session 1 - HTML Fundamentals
Introduction to Frontend Development - Session 1 - HTML Fundamentals
 
CSS Adnaved with HTML abd complete Stylesheet
CSS Adnaved with HTML abd complete StylesheetCSS Adnaved with HTML abd complete Stylesheet
CSS Adnaved with HTML abd complete Stylesheet
 
sl slides-unit-1.pptx
sl slides-unit-1.pptxsl slides-unit-1.pptx
sl slides-unit-1.pptx
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
 
javascript 1
javascript 1javascript 1
javascript 1
 
HTML for absolutely begginers
HTML for absolutely begginersHTML for absolutely begginers
HTML for absolutely begginers
 
Ddpz2613 topic1 introduction
Ddpz2613 topic1 introductionDdpz2613 topic1 introduction
Ddpz2613 topic1 introduction
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 
Javascript
JavascriptJavascript
Javascript
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
Week 8 intro to python
Week 8   intro to pythonWeek 8   intro to python
Week 8 intro to python
 
Top 10 programming languages
Top 10 programming languagesTop 10 programming languages
Top 10 programming languages
 
7 Top PHP Development Tools For PHP Coding
7 Top PHP Development Tools For PHP Coding7 Top PHP Development Tools For PHP Coding
7 Top PHP Development Tools For PHP Coding
 

Mais de Kumar

Graphics devices
Graphics devicesGraphics devices
Graphics devicesKumar
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithmsKumar
 
region-filling
region-fillingregion-filling
region-fillingKumar
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivationKumar
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons dericationKumar
 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xsltKumar
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xmlKumar
 
Xml basics
Xml basicsXml basics
Xml basicsKumar
 
XML Schema
XML SchemaXML Schema
XML SchemaKumar
 
Publishing xml
Publishing xmlPublishing xml
Publishing xmlKumar
 
Applying xml
Applying xmlApplying xml
Applying xmlKumar
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLKumar
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee applicationKumar
 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLKumar
 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB FundmentalsKumar
 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programmingKumar
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programmingKumar
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversKumar
 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EEKumar
 

Mais de Kumar (20)

Graphics devices
Graphics devicesGraphics devices
Graphics devices
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
 
region-filling
region-fillingregion-filling
region-filling
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivation
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xslt
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
 
Xml basics
Xml basicsXml basics
Xml basics
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Publishing xml
Publishing xmlPublishing xml
Publishing xml
 
DTD
DTDDTD
DTD
 
Applying xml
Applying xmlApplying xml
Applying xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee application
 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XML
 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB Fundmentals
 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programming
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programming
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC Drivers
 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EE
 

introduction to javascript

  • 1. Tutorial 1 Introduction to JavaScript Section A – Programming, HTML, and JavaScript JavaScript Tutorial 1 - Introduction to JavaScript 1
  • 2. Tutorial 1A Topics  Section A – Programming, HTML, and JavaScript • About the World Wide Web • Uses of JavaScript • About Hypertext Markup Language • How to creating an HTML document • About the JavaScript programming language • About logic and debugging JavaScript 2 Tutorial 1 - Introduction
  • 3. Programming, HTML, and JavaScript  The World Wide Web • Created in 1989  European Laboratory for Particle Physics (Geneva Switzerland) • Purpose  Provide an easy way to access cross- referenced documents that exist on the internet JavaScript 3 Tutorial 1 - Introduction
  • 4. Programming, HTML, and JavaScript  The World Wide Web • Hypertext links  Contain reference to locate and open specific documents • Hypertext Markup Language (HTML)  Language used to design web pages (documents) • Web Browser  Program that displays HTML documents JavaScript 4 Tutorial 1 - Introduction
  • 5. Programming, HTML, and JavaScript  The World Wide Web • Uniform Resource Locator (URL)  A type of Uniform Resource Identifier (URI) • Identifies names and addresses on the WWW  A unique identifier for a web document • e.g., a telephone number or mailing address JavaScript 5 Tutorial 1 - Introduction
  • 6. Programming, HTML, and JavaScript  The World Wide Web • Uniform Resource Locator (URL)  Consists of 4 parts: • Protocol → Hyper Text Transfer Protocol (HTTP) • Domain Name → or Internet Protocol (IP) address • Directory • Filename  Specific document filename  index.(s)htm(l) or default.(s)htm(l) JavaScript 6 Tutorial 1 - Introduction
  • 7. JavaScript 7 Tutorial 1 - Introduction
  • 8. Programming, HTML, and JavaScript  JavaScript’s role on the Web • HTML  Purpose → tell the browser how a document should appear  Static → can view or print (no interaction) JavaScript 8 Tutorial 1 - Introduction
  • 9. Programming, HTML, and JavaScript  JavaScript’s role on the Web • JavaScript Programming Language  Developed by Netscape for use in Navigator Web Browsers  Purpose → make web pages (documents) more dynamic and interactive • Change contents of document, provide forms and controls, animation, control web browser window, etc. JavaScript 9 Tutorial 1 - Introduction
  • 10. JavaScript 10 Tutorial 1 - Introduction
  • 11. JavaScript 11 Tutorial 1 - Introduction
  • 12. JavaScript 12 Tutorial 1 - Introduction
  • 13. Programming, HTML, and JavaScript  Hypertext Markup Language • HTML Document  Text document that contains: • Tags → formatting instructions • Text to be displayed  Document is parsed or rendered by browser JavaScript 13 Tutorial 1 - Introduction
  • 14. Programming, HTML, and JavaScript  Hypertext Markup Language • HTML Document  Tags • Enclosed in brackets <tag> • Generally consist of:  Opening tags <tag>  Closing tags </tag> • Text contained between the opening and closing tags are formatted according to tag instructions JavaScript 14 Tutorial 1 - Introduction
  • 15. Programming, HTML, and JavaScript  Hypertext Markup Language • HTML Document  Tags • All HTML documents begin with <html> tag and end with </html> • HTML is not case sensitive JavaScript 15 Tutorial 1 - Introduction
  • 16. Programming, HTML, and JavaScript  Hypertext Markup Language • HTML Document  Tag Attributes • Used to configure tags • Placed before closing bracket of opening tag  <tag attribute=“value”>some text</tag> JavaScript 16 Tutorial 1 - Introduction
  • 17. JavaScript 17 Tutorial 1 - Introduction
  • 18. JavaScript 18 Tutorial 1 - Introduction
  • 19. JavaScript 19 Tutorial 1 - Introduction
  • 20. Programming, HTML, and JavaScript  Hypertext Markup Language • HTML Document  Web browser only acknowledges text and valid tags  Web browser ignores non-printing characters • Spaces, tabs, carriage returns  Must use valid tags or special character codes to accomplish this: • Non-breaking space → &nbsp; JavaScript 20 Tutorial 1 - Introduction
  • 21. JavaScript 21 Tutorial 1 - Introduction
  • 22. JavaScript 22 Tutorial 1 - Introduction
  • 23. Programming, HTML, and JavaScript  Creating an HTML Document • Text editor (text)  Notepad, WordPad • Word Processor (that can create text files)  Word • HTML Editor (WYSIWYG)  FrontPage, PageMill • HTML Converters (WYSIWYG)  Word, PowerPoint JavaScript 23 Tutorial 1 - Introduction
  • 24. JavaScript 24 Tutorial 1 - Introduction
  • 25. Programming, HTML, and JavaScript  The JavaScript Programming Language • Scripting Languages  Executed by an interpreter contained within the web browser (scripting host)  Interpreter uses a scripting engine • Converts code to executable format each time it runs • Converted when browser loads web document JavaScript 25 Tutorial 1 - Introduction
  • 26. Programming, HTML, and JavaScript  The JavaScript Programming Language • JavaScript  Originally called LiveScript when introduced in Netscape Navigator  In Navigator 2.0, name changed to JavaScript  Current version 1.5 • JScript  MS version of JavaScript • Current version 5.5 JavaScript 26 Tutorial 1 - Introduction
  • 27. Programming, HTML, and JavaScript  The JavaScript Programming Language • ECMAScript  International, standardized version (Edition 3)  Both versions (JavaScript and JScript) conform to the standard • Although both have proprietary extensions  Focus of this text JavaScript 27 Tutorial 1 - Introduction
  • 28. Programming, HTML, and JavaScript  The JavaScript Programming Language • JavaScript  Two formats: • Client-side  Program runs on client (browser) • Server-side  Program runs on server  Proprietary to web server platform JavaScript 28 Tutorial 1 - Introduction
  • 29. JavaScript 29 Tutorial 1 - Introduction
  • 30. Programming, HTML, and JavaScript  Logic and Debugging • Syntax  Rules of the language • Logic  Order of execution of various parts of the program JavaScript 30 Tutorial 1 - Introduction
  • 31. Programming, HTML, and JavaScript  Logic and Debugging • Syntax error  Misuse of syntax • e.g., typing fer instead of for • Logic errors  Unintended operation of program • e.g., Infinite loop JavaScript 31 Tutorial 1 - Introduction
  • 32. Programming, HTML, and JavaScript  Logic and Debugging • Debugging  Tracing and resolving errors in a program  Coined by Admiral Grace Hopper • Moth short-circuited a relay  “bug” in the system • Removed it → system “debugged”  Not an exact science JavaScript 32 Tutorial 1 - Introduction