SlideShare a Scribd company logo
1 of 13
© 2005-2011 iMetaTechnologies Limited Re-Learning JavaScript Michael Godfrey DD:  Mobile:  Email: mgodfrey@imeta.co.uk
Re-Learning JavaScript old school JavaScript == browser scripting == painful © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript example – assigning event handlers, e.g. for menu rollovers: element.on<eventname> element.attachEvent element.addEventListener © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript jQuery “is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.” MooTools “allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.” © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript	 jQuery.bind()  “Attach a handler to an event for the elements.” © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript jQuery is just JavaScript! Important to understand underlying language and implementation environment in detail. © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript © 2005-2011 iMeta Technologies Limited OO and functional-based JavaScript Looks a bit like LINQ, but how does it work?
Re-Learning JavaScript { Objects } Literal notation, name value pairs, quick! Not based on a class blueprint. Inherits from Object.prototype, accessed via ugly __proto__ property. © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript Functions() Invokable objects, hence properties allowed. Inherits from Function.prototype, accessed via ugly __proto__ property Created with a prototype property, a new object inheriting from Object.prototype. © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript Constructor Functions() Invoked with new keyword. Creates an empty object referenced by this keyword. this inherits the prototype of the constructor function. this is returned. © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript	 Callbacks Functions as parameters to other functions. Very useful for asynchronous programming. © 2005-2011 iMeta Technologies Limited
Re-Learning JavaScript © 2005-2011 iMeta Technologies Limited OO and functional-based JavaScript Now let’s look at the source 
Re-Learning JavaScript CoffeeScript “is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.” It also makes our example look even more like LINQ! © 2005-2007 imeta Technologies Limited

More Related Content

What's hot

Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APIDavid Keener
 
Hands on react native
Hands on react nativeHands on react native
Hands on react nativeJay Nagar
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingEmanuele DelBono
 
Angular 8 Services and Dependency Injection - William Liebenberg
Angular 8 Services and Dependency Injection - William LiebenbergAngular 8 Services and Dependency Injection - William Liebenberg
Angular 8 Services and Dependency Injection - William LiebenbergWilliam Liebenberg
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015DotNetCampus
 
Introduction to React Native Workshop
Introduction to React Native WorkshopIntroduction to React Native Workshop
Introduction to React Native WorkshopIgnacio Martín
 
Get your mobile app in production in 3 months: Backend
Get your mobile app in production in 3 months: BackendGet your mobile app in production in 3 months: Backend
Get your mobile app in production in 3 months: BackendAckee
 
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsGet your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsAckee
 
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsGet your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsAckee
 
TRAX technical highlights
TRAX technical highlightsTRAX technical highlights
TRAX technical highlightsESUG
 
S60 3rd FP2 Widgets
S60 3rd FP2 WidgetsS60 3rd FP2 Widgets
S60 3rd FP2 Widgetsromek
 
Get your mobile app in production in 3 months: DevOps and Infrastructure
Get your mobile app in production in 3 months: DevOps and InfrastructureGet your mobile app in production in 3 months: DevOps and Infrastructure
Get your mobile app in production in 3 months: DevOps and InfrastructureAckee
 
React native introduction
React native introductionReact native introduction
React native introductionInnerFood
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBoxKobkrit Viriyayudhakorn
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An OverviewJalpesh Vadgama
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererPivorak MeetUp
 
Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integrationdfeyer
 

What's hot (20)

Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
Hands on react native
Hands on react nativeHands on react native
Hands on react native
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
 
Angular 8 Services and Dependency Injection - William Liebenberg
Angular 8 Services and Dependency Injection - William LiebenbergAngular 8 Services and Dependency Injection - William Liebenberg
Angular 8 Services and Dependency Injection - William Liebenberg
 
Linq
LinqLinq
Linq
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015
 
Introduction to React Native Workshop
Introduction to React Native WorkshopIntroduction to React Native Workshop
Introduction to React Native Workshop
 
Get your mobile app in production in 3 months: Backend
Get your mobile app in production in 3 months: BackendGet your mobile app in production in 3 months: Backend
Get your mobile app in production in 3 months: Backend
 
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsGet your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
 
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile AppsGet your mobile app in production in 3 months: Native and Reactive Mobile Apps
Get your mobile app in production in 3 months: Native and Reactive Mobile Apps
 
TRAX technical highlights
TRAX technical highlightsTRAX technical highlights
TRAX technical highlights
 
S60 3rd FP2 Widgets
S60 3rd FP2 WidgetsS60 3rd FP2 Widgets
S60 3rd FP2 Widgets
 
Get your mobile app in production in 3 months: DevOps and Infrastructure
Get your mobile app in production in 3 months: DevOps and InfrastructureGet your mobile app in production in 3 months: DevOps and Infrastructure
Get your mobile app in production in 3 months: DevOps and Infrastructure
 
React native introduction
React native introductionReact native introduction
React native introduction
 
ReactJs
ReactJsReactJs
ReactJs
 
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
[React Native] Lecture 4: Basic Elements and UI Layout by using FlexBox
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick Sutterer
 
Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integration
 

Viewers also liked

Eines pel treball diari
Eines pel treball diariEines pel treball diari
Eines pel treball diariAnna Fabra
 
Media presentation
Media presentation Media presentation
Media presentation georgiai
 
Media evaluation
Media evaluationMedia evaluation
Media evaluationgeorgiai
 
Horror questionnaire results
Horror questionnaire resultsHorror questionnaire results
Horror questionnaire resultsgeorgiai
 
Evaluation question 4
Evaluation question 4Evaluation question 4
Evaluation question 4georgiai
 
Evaluation question 4
Evaluation question 4Evaluation question 4
Evaluation question 4georgiai
 

Viewers also liked (8)

Eines pel treball diari
Eines pel treball diariEines pel treball diari
Eines pel treball diari
 
Media presentation
Media presentation Media presentation
Media presentation
 
Media evaluation
Media evaluationMedia evaluation
Media evaluation
 
Horror questionnaire results
Horror questionnaire resultsHorror questionnaire results
Horror questionnaire results
 
Evaluation question 4
Evaluation question 4Evaluation question 4
Evaluation question 4
 
Evaluation question 4
Evaluation question 4Evaluation question 4
Evaluation question 4
 
Bud1kl
Bud1klBud1kl
Bud1kl
 
21071
2107121071
21071
 

Similar to Re-Learning JavaScript

Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)Mickael Istria
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav DukhinFwdays
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jqueryduygut
 
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Expbakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_ExpBakkesh K S
 
M6 l7-java script-handout
M6 l7-java script-handoutM6 l7-java script-handout
M6 l7-java script-handoutNolboo Kim
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleSpringPeople
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012daniel plocker
 
CUST-8 Tackling a Complex User Interface
CUST-8 Tackling a Complex User InterfaceCUST-8 Tackling a Complex User Interface
CUST-8 Tackling a Complex User InterfaceAlfresco Software
 
Mail Merge Documents With Aspnet
Mail Merge Documents With AspnetMail Merge Documents With Aspnet
Mail Merge Documents With AspnetJames Johnson
 
JAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 WebdesignJAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 WebdesignNitinShelake4
 
Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011schusco12
 
Online test management system
Online test management systemOnline test management system
Online test management systemPrateek Agarwak
 

Similar to Re-Learning JavaScript (20)

Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
Whats new in Eclipse Indigo ? (@DemoCamp Grenoble 2011)
 
React a11y-csun
React a11y-csunReact a11y-csun
React a11y-csun
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jquery
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Expbakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
 
M6 l7-java script-handout
M6 l7-java script-handoutM6 l7-java script-handout
M6 l7-java script-handout
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeople
 
Tahir_Resume_Selenium
Tahir_Resume_SeleniumTahir_Resume_Selenium
Tahir_Resume_Selenium
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
CUST-8 Tackling a Complex User Interface
CUST-8 Tackling a Complex User InterfaceCUST-8 Tackling a Complex User Interface
CUST-8 Tackling a Complex User Interface
 
Mail Merge Documents With Aspnet
Mail Merge Documents With AspnetMail Merge Documents With Aspnet
Mail Merge Documents With Aspnet
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
J Query
J QueryJ Query
J Query
 
JAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 WebdesignJAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 Webdesign
 
Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011
 
Online test management system
Online test management systemOnline test management system
Online test management system
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Re-Learning JavaScript

  • 1. © 2005-2011 iMetaTechnologies Limited Re-Learning JavaScript Michael Godfrey DD: Mobile: Email: mgodfrey@imeta.co.uk
  • 2. Re-Learning JavaScript old school JavaScript == browser scripting == painful © 2005-2011 iMeta Technologies Limited
  • 3. Re-Learning JavaScript example – assigning event handlers, e.g. for menu rollovers: element.on<eventname> element.attachEvent element.addEventListener © 2005-2011 iMeta Technologies Limited
  • 4. Re-Learning JavaScript jQuery “is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.” MooTools “allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.” © 2005-2011 iMeta Technologies Limited
  • 5. Re-Learning JavaScript jQuery.bind() “Attach a handler to an event for the elements.” © 2005-2011 iMeta Technologies Limited
  • 6. Re-Learning JavaScript jQuery is just JavaScript! Important to understand underlying language and implementation environment in detail. © 2005-2011 iMeta Technologies Limited
  • 7. Re-Learning JavaScript © 2005-2011 iMeta Technologies Limited OO and functional-based JavaScript Looks a bit like LINQ, but how does it work?
  • 8. Re-Learning JavaScript { Objects } Literal notation, name value pairs, quick! Not based on a class blueprint. Inherits from Object.prototype, accessed via ugly __proto__ property. © 2005-2011 iMeta Technologies Limited
  • 9. Re-Learning JavaScript Functions() Invokable objects, hence properties allowed. Inherits from Function.prototype, accessed via ugly __proto__ property Created with a prototype property, a new object inheriting from Object.prototype. © 2005-2011 iMeta Technologies Limited
  • 10. Re-Learning JavaScript Constructor Functions() Invoked with new keyword. Creates an empty object referenced by this keyword. this inherits the prototype of the constructor function. this is returned. © 2005-2011 iMeta Technologies Limited
  • 11. Re-Learning JavaScript Callbacks Functions as parameters to other functions. Very useful for asynchronous programming. © 2005-2011 iMeta Technologies Limited
  • 12. Re-Learning JavaScript © 2005-2011 iMeta Technologies Limited OO and functional-based JavaScript Now let’s look at the source 
  • 13. Re-Learning JavaScript CoffeeScript “is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.” It also makes our example look even more like LINQ! © 2005-2007 imeta Technologies Limited

Editor's Notes

  1. element.on&lt;eventname&gt;, e.g. element.onmouseove = function(e){};Netscape’s traditional event registration model, universally supported (i.e. cross-browser compatible), big drawback = only one event handler can be registered. Therefore when multiple handlers are required a wrapping function must be created.element.attachEvent, Microsoft’s solution to the big drawback of Netscape’s traditional model.element.addEventListener, W3C’s solution and therefore the standard.http://www.quirksmode.org/js/events_tradmod.htmlhttp://www.quirksmode.org/js/events_advanced.html
  2. Line 2361 – jQuery.each([&quot;bind&quot;, &quot;one&quot;], function( i, name ) { ...jQuery.fn[ name ] = function( type, data, fn ) { ... jQuery.event.add( this[i], type, handler, data ); ... }; ...});Line 1555 –jQuery.event = { // Bind an event to an element add: function( elem, types, handler, data ) { ... // Bind the global event handler to the elementif ( elem.addEventListener ) {elem.addEventListener( type, eventHandle, false );} else if ( elem.attachEvent ) {elem.attachEvent( &quot;on&quot; + type, eventHandle );} ... }; ...};
  3. AjQuery object is commonly made using a CSS selector, e.g. $(“#menu &gt; li”) equates to “select all &lt;li&gt;’s that are a direct child of the element with id ‘menu’”, http://www.w3.org/TR/CSS2/selector.html.In which direction would a browser read a CSS selector such as “#menu &gt; li”?Rightmost first! Therefore “#menu &gt; li” will actually find every li element on the page and then check to see if it is a direct descendant of the element with id ‘menu’.css.selectors.htm will match 6 li elements before using the child rule to limit the result set down to 3 li elements.http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/https://developer.mozilla.org/en/Writing_Efficient_CSS
  4. http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx
  5. http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx