SlideShare a Scribd company logo
SFDV2001 – Web Development Lecture  3: JavaScript
History – Mechanical Programs Charles Babbage Developed the first mechanical computation. Created the Difference Engine. Designed the Analytical Engine. Ada Byron, Lady Lovelace Described the uses of the Analytical Engine. Helped create the first computer program. 11/09/07 (SFDV2001:15)JavaScript
History - Computability Alan Turing Defined the set of all things that  could be computed. Studied computability. Tests for Artificial Intelligence. War hero Worked at Bletchley Park. Headed the group working on breaking the Enigma. Developed electronic machines to break codes. 11/09/07 (SFDV2001:15)JavaScript
History – Modern Computers John von Neumann Mathematician and Physicist. Worked on the H-bomb. Contributed to many areas. Computer Design Processing unit. Memory. Input and output. 11/09/07 (SFDV2001:15)JavaScript
Computer Design Central processing unit (CPU) ‏ A central core that processes instructions . Increments a program counter. Has small internal storage. Memory (RAM) ‏ An area to hold programs and data. Accessible from the CPU. An address for every location. Bus connects CPU to memory. 11/09/07 (SFDV2001:15)JavaScript
Computer Design Input Punch cards and switches. Keyboards, mouse, camera,... Scanners. GSR Galvanic Skin Response. nMRI. Output Flashing lights, cards. Screens, printers, speakers,...  Computer Aided Machining.  11/09/07 (SFDV2001:15)JavaScript
Programming Writing programs for computing devices Remember Sequence  Selection Repetition Central Processing Unit runs these instructions. Memory holds data. Input allows interaction. Output lets us see what is going on. 11/09/07 (SFDV2001:15)JavaScript
Scripting A script is a list of stuff to do. Works through a application that interprets the “script”. Scripting ability added to Netscape v2.0 Initially mocha then LiveScript. Simple instructions. New commands added over time. 11/09/07 (SFDV2001:15)JavaScript
JavaScript JavaScript is NOT JAVA Similarity  both used on the web. similar syntax, based on C. Objects are important. Not a universal standard Ecma standard script is similar. IE implements similar script called JScript. Different bowsers different behaviour. 11/09/07 (SFDV2001:15)JavaScript C Java JavaScript
JavaScript Provides tools for: Mouse over events Checking Navigation Changing display Uses include: Allows developer to do more than HTML Making pages responsive to the user Much of the early uses superseded by CSS 11/09/07 (SFDV2001:15)JavaScript
Including JavaScript Script tag <script type=”....”>  </script> HTML comment <!-- so old browsers do not try to interpret it JavaScript comment // before the  --> so JavaScript does not try to interpret that bit 11/09/07 (SFDV2001:15)JavaScript <script type=”text/javascript”> <!-- javascript code //--> </script>
Commenting HTML comments  <!--  --> JavaScript comments  /*  */   to end of line // Allows the developer to make notes and clarify issues. Common comments include Author  Dates and  versions  Problems and bugs Explanation of complex processes 11/09/07 (SFDV2001:15)JavaScript
Variables A name for an object var age = 31 Can be numbers  31 text “simon” boolean true/false null Example x = 5, y = 3 document.writeln(x + y); outputs 8 11/09/07 (SFDV2001:15)JavaScript
Functions and Methods A block of instructions that are collected together. Allows reuse of code. Makes things easier to read. Examples document. write (“Hello World”); Date (); Math. sqrt (25); A method is a function attached to an object. 11/09/07 (SFDV2001:15)JavaScript
Parameters Variables or values passed to functions. document.writeln( “string” ) ‏ passed the string to write. window.open( “url”, “name”, “features” ) ‏ passed stings for: url,  name features of the window Math.sqrt( number ) ‏ passed the number to square root. 11/09/07 (SFDV2001:15)JavaScript
Examples MouseOver effects Usually changing an image Can do other things, like popups CSS is better for mouse overs that just change images. 11/09/07 (SFDV2001:15)JavaScript <img align=right src=&quot;cosc_logo.jpg&quot;  onMouseOver = this.src=&quot;unilogo.gif&quot; onMouseOut  = this.src=&quot;cslogo.jpg&quot;> <img align=right src=&quot;cosc_logo.jpg&quot;  onMouseOver = this.src=&quot;unilogo.gif&quot; onMouseOut  = this.src=&quot;cslogo.jpg&quot;> <img align=right src=&quot;cosc_logo.jpg&quot;  onMouseOver = window.open(“http://www.otago.ac.nz”)> Change to local examples
Examples Popups Those irritating new windows Blocked by lots of browsers and browser extensions Last string for features such as toolbar, location, directories, status, menubar,.... width=pixels height=pixels Please don't use popups  11/09/07 (SFDV2001:15)JavaScript window.open(“http://www.otago.ac.nz”,”otago”,””) ‏ window.open(“”,”otago”,”width=40,height=40”) ‏
Examples Form validation Good use of JavaScript. Checks: numbers are numbers dates are valid  all data has been entered Gives feedback about selected items More about this next week 11/09/07 (SFDV2001:15)JavaScript
Event Driven Programming Responding to things like Mouse Clicks Keystrokes Windows opening Program termination JavaScript responds to events rather than polling. Polling – Are we there yet?, Are we there yet?, Are we there yet? Are.......... Event – Car stopping - “Are we there?” 11/09/07 (SFDV2001:15)JavaScript
Next The DOM and JavaScript. More examples of JavaScript. Objects. Form validation. Problems with JavaScript. 11/09/07 (SFDV2001:15)JavaScript

More Related Content

What's hot (20)

PPT
Lecture 9 Professional Practices
Sur College of Applied Sciences
 
PDF
Taiwan Web Standards Talk 2011
Zi Bin Cheah
 
KEY
Intro to html5 Boilerplate
Michael Enslow
 
ZIP
Looking into HTML5
Christopher Schmitt
 
PDF
HTML 5 Step By Step - Ebook
Scottperrone
 
PPT
Eugene Andruszczenko: jQuery
Refresh Events
 
PDF
Web Development for UX Designers
Ashlimarie
 
KEY
An Introduction to HTML5
Steven Chipman
 
PPT
WordPress Development Confoo 2010
Brendan Sera-Shriar
 
PDF
Fewd week4 slides
William Myers
 
PDF
HTML5 & Friends
Remy Sharp
 
PPTX
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
ODP
Ant User Guide
Muthuselvam RS
 
PPT
Lecture1 B Frames&Forms
Sur College of Applied Sciences
 
PPT
HTML 5 Overview
Offir Ariel
 
PDF
HTML5: features with examples
Alfredo Torre
 
PPTX
Html 5 tutorial - By Bally Chohan
ballychohanuk
 
PDF
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
PPTX
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
Lecture 9 Professional Practices
Sur College of Applied Sciences
 
Taiwan Web Standards Talk 2011
Zi Bin Cheah
 
Intro to html5 Boilerplate
Michael Enslow
 
Looking into HTML5
Christopher Schmitt
 
HTML 5 Step By Step - Ebook
Scottperrone
 
Eugene Andruszczenko: jQuery
Refresh Events
 
Web Development for UX Designers
Ashlimarie
 
An Introduction to HTML5
Steven Chipman
 
WordPress Development Confoo 2010
Brendan Sera-Shriar
 
Fewd week4 slides
William Myers
 
HTML5 & Friends
Remy Sharp
 
JavaScript Presentation Frameworks and Libraries
Oleksii Prohonnyi
 
Ant User Guide
Muthuselvam RS
 
Lecture1 B Frames&Forms
Sur College of Applied Sciences
 
HTML 5 Overview
Offir Ariel
 
HTML5: features with examples
Alfredo Torre
 
Html 5 tutorial - By Bally Chohan
ballychohanuk
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 

Viewers also liked (11)

PPT
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 
PPT
WordPress made for humans
Stefanos Kofopoulos
 
PDF
2/2 slave labor on farms
StopTrafficking
 
PDF
JavaScript introduction 1 ( Variables And Values )
Victor Verhaagen
 
PPT
eXo SEA - JavaScript Introduction Training
Hoat Le
 
PPT
introduction to javascript
Kumar
 
PDF
JavaScript Basics And DOM Manipulation
Siarhei Barysiuk
 
KEY
Introduction to Javascript - College Lecture
Zac Gordon
 
PPT
Introduction to JavaScript
Andres Baravalle
 
PPT
Introduction to Javascript
Amit Tyagi
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
Lecture 5 - Comm Lab: Web @ ITP
yucefmerhi
 
WordPress made for humans
Stefanos Kofopoulos
 
2/2 slave labor on farms
StopTrafficking
 
JavaScript introduction 1 ( Variables And Values )
Victor Verhaagen
 
eXo SEA - JavaScript Introduction Training
Hoat Le
 
introduction to javascript
Kumar
 
JavaScript Basics And DOM Manipulation
Siarhei Barysiuk
 
Introduction to Javascript - College Lecture
Zac Gordon
 
Introduction to JavaScript
Andres Baravalle
 
Introduction to Javascript
Amit Tyagi
 
JavaScript - An Introduction
Manvendra Singh
 
Ad

Similar to Lecture 3 Javascript1 (20)

PPT
GWT is Smarter Than You
Robert Cooper
 
PPTX
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
PPT
WebGL: GPU acceleration for the open web
pjcozzi
 
PPT
Web II - 01 - Introduction to server-side development
Randy Connolly
 
PPT
(In)Security Implication in the JS Universe
Stefano Di Paola
 
PPT
Developing Java Web Applications
hchen1
 
PDF
Get Ahead with HTML5 on Moible
markuskobler
 
PPT
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
george.james
 
PDF
8.-Javascript-report powerpoint presentation
JohnLagman3
 
PPTX
Java script Basic
Jaya Kumari
 
PDF
Javascript - Ebook (A Quick Guide)
sourav newatia
 
PPTX
Confoo - Javascript Server Side : How to start
Quentin Adam
 
PPTX
That’s not your var – JavaScript best practices for C# developers
György Balássy
 
PDF
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
David Wesst
 
PPT
High Performance Ajax Applications 1197671494632682 2
Niti Chotkaew
 
PPT
High Performance Ajax Applications
Julien Lecomte
 
PPT
Ajax World 2008
Axway Appcelerator
 
PPT
Ajaxworld March 2008 - Jeff Haynie Keynote - Appcelerator
Jeff Haynie
 
PDF
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Matt Raible
 
ODP
Ample SDK: A tour de force
Sergey Ilinsky
 
GWT is Smarter Than You
Robert Cooper
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
WebGL: GPU acceleration for the open web
pjcozzi
 
Web II - 01 - Introduction to server-side development
Randy Connolly
 
(In)Security Implication in the JS Universe
Stefano Di Paola
 
Developing Java Web Applications
hchen1
 
Get Ahead with HTML5 on Moible
markuskobler
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
george.james
 
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Java script Basic
Jaya Kumari
 
Javascript - Ebook (A Quick Guide)
sourav newatia
 
Confoo - Javascript Server Side : How to start
Quentin Adam
 
That’s not your var – JavaScript best practices for C# developers
György Balássy
 
JavaScript Revolution - 5/Nov/13 - PrDC Saskatoon, SK
David Wesst
 
High Performance Ajax Applications 1197671494632682 2
Niti Chotkaew
 
High Performance Ajax Applications
Julien Lecomte
 
Ajax World 2008
Axway Appcelerator
 
Ajaxworld March 2008 - Jeff Haynie Keynote - Appcelerator
Jeff Haynie
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Matt Raible
 
Ample SDK: A tour de force
Sergey Ilinsky
 
Ad

More from Sur College of Applied Sciences (11)

PPT
Lecture11 A Image
Sur College of Applied Sciences
 
PPT
Lecture 11 B Security
Sur College of Applied Sciences
 
PPT
Lecture 10 Image Format
Sur College of Applied Sciences
 
PPT
Lecture 9 Usability Orignal
Sur College of Applied Sciences
 
PPT
Lecture 9 Accessibility Original
Sur College of Applied Sciences
 
PPT
Accessibility Usability Professional Summry
Sur College of Applied Sciences
 
Lecture 11 B Security
Sur College of Applied Sciences
 
Lecture 10 Image Format
Sur College of Applied Sciences
 
Lecture 9 Usability Orignal
Sur College of Applied Sciences
 
Lecture 9 Accessibility Original
Sur College of Applied Sciences
 
Accessibility Usability Professional Summry
Sur College of Applied Sciences
 

Recently uploaded (20)

PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
epi editorial commitee meeting presentation
MIPLM
 
infertility, types,causes, impact, and management
Ritu480198
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Controller Request and Response in Odoo18
Celine George
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Horarios de distribución de agua en julio
pegazohn1978
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 

Lecture 3 Javascript1

  • 1. SFDV2001 – Web Development Lecture 3: JavaScript
  • 2. History – Mechanical Programs Charles Babbage Developed the first mechanical computation. Created the Difference Engine. Designed the Analytical Engine. Ada Byron, Lady Lovelace Described the uses of the Analytical Engine. Helped create the first computer program. 11/09/07 (SFDV2001:15)JavaScript
  • 3. History - Computability Alan Turing Defined the set of all things that could be computed. Studied computability. Tests for Artificial Intelligence. War hero Worked at Bletchley Park. Headed the group working on breaking the Enigma. Developed electronic machines to break codes. 11/09/07 (SFDV2001:15)JavaScript
  • 4. History – Modern Computers John von Neumann Mathematician and Physicist. Worked on the H-bomb. Contributed to many areas. Computer Design Processing unit. Memory. Input and output. 11/09/07 (SFDV2001:15)JavaScript
  • 5. Computer Design Central processing unit (CPU) ‏ A central core that processes instructions . Increments a program counter. Has small internal storage. Memory (RAM) ‏ An area to hold programs and data. Accessible from the CPU. An address for every location. Bus connects CPU to memory. 11/09/07 (SFDV2001:15)JavaScript
  • 6. Computer Design Input Punch cards and switches. Keyboards, mouse, camera,... Scanners. GSR Galvanic Skin Response. nMRI. Output Flashing lights, cards. Screens, printers, speakers,... Computer Aided Machining. 11/09/07 (SFDV2001:15)JavaScript
  • 7. Programming Writing programs for computing devices Remember Sequence Selection Repetition Central Processing Unit runs these instructions. Memory holds data. Input allows interaction. Output lets us see what is going on. 11/09/07 (SFDV2001:15)JavaScript
  • 8. Scripting A script is a list of stuff to do. Works through a application that interprets the “script”. Scripting ability added to Netscape v2.0 Initially mocha then LiveScript. Simple instructions. New commands added over time. 11/09/07 (SFDV2001:15)JavaScript
  • 9. JavaScript JavaScript is NOT JAVA Similarity both used on the web. similar syntax, based on C. Objects are important. Not a universal standard Ecma standard script is similar. IE implements similar script called JScript. Different bowsers different behaviour. 11/09/07 (SFDV2001:15)JavaScript C Java JavaScript
  • 10. JavaScript Provides tools for: Mouse over events Checking Navigation Changing display Uses include: Allows developer to do more than HTML Making pages responsive to the user Much of the early uses superseded by CSS 11/09/07 (SFDV2001:15)JavaScript
  • 11. Including JavaScript Script tag <script type=”....”> </script> HTML comment <!-- so old browsers do not try to interpret it JavaScript comment // before the --> so JavaScript does not try to interpret that bit 11/09/07 (SFDV2001:15)JavaScript <script type=”text/javascript”> <!-- javascript code //--> </script>
  • 12. Commenting HTML comments <!-- --> JavaScript comments /* */ to end of line // Allows the developer to make notes and clarify issues. Common comments include Author Dates and versions Problems and bugs Explanation of complex processes 11/09/07 (SFDV2001:15)JavaScript
  • 13. Variables A name for an object var age = 31 Can be numbers 31 text “simon” boolean true/false null Example x = 5, y = 3 document.writeln(x + y); outputs 8 11/09/07 (SFDV2001:15)JavaScript
  • 14. Functions and Methods A block of instructions that are collected together. Allows reuse of code. Makes things easier to read. Examples document. write (“Hello World”); Date (); Math. sqrt (25); A method is a function attached to an object. 11/09/07 (SFDV2001:15)JavaScript
  • 15. Parameters Variables or values passed to functions. document.writeln( “string” ) ‏ passed the string to write. window.open( “url”, “name”, “features” ) ‏ passed stings for: url, name features of the window Math.sqrt( number ) ‏ passed the number to square root. 11/09/07 (SFDV2001:15)JavaScript
  • 16. Examples MouseOver effects Usually changing an image Can do other things, like popups CSS is better for mouse overs that just change images. 11/09/07 (SFDV2001:15)JavaScript <img align=right src=&quot;cosc_logo.jpg&quot; onMouseOver = this.src=&quot;unilogo.gif&quot; onMouseOut = this.src=&quot;cslogo.jpg&quot;> <img align=right src=&quot;cosc_logo.jpg&quot; onMouseOver = this.src=&quot;unilogo.gif&quot; onMouseOut = this.src=&quot;cslogo.jpg&quot;> <img align=right src=&quot;cosc_logo.jpg&quot; onMouseOver = window.open(“http://www.otago.ac.nz”)> Change to local examples
  • 17. Examples Popups Those irritating new windows Blocked by lots of browsers and browser extensions Last string for features such as toolbar, location, directories, status, menubar,.... width=pixels height=pixels Please don't use popups 11/09/07 (SFDV2001:15)JavaScript window.open(“http://www.otago.ac.nz”,”otago”,””) ‏ window.open(“”,”otago”,”width=40,height=40”) ‏
  • 18. Examples Form validation Good use of JavaScript. Checks: numbers are numbers dates are valid all data has been entered Gives feedback about selected items More about this next week 11/09/07 (SFDV2001:15)JavaScript
  • 19. Event Driven Programming Responding to things like Mouse Clicks Keystrokes Windows opening Program termination JavaScript responds to events rather than polling. Polling – Are we there yet?, Are we there yet?, Are we there yet? Are.......... Event – Car stopping - “Are we there?” 11/09/07 (SFDV2001:15)JavaScript
  • 20. Next The DOM and JavaScript. More examples of JavaScript. Objects. Form validation. Problems with JavaScript. 11/09/07 (SFDV2001:15)JavaScript

Editor's Notes

  • #17: Change to local examples