SlideShare a Scribd company logo
© 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 API
David Keener
 
Hands on react native
Hands on react nativeHands on react native
Hands on react native
Jay Nagar
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
Emanuele 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 Liebenberg
William Liebenberg
 
Linq
LinqLinq
Linq
tnkreddy
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015
DotNetCampus
 
Introduction to React Native Workshop
Introduction to React Native WorkshopIntroduction to React Native Workshop
Introduction to React Native Workshop
Ignacio 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: Backend
Ackee
 
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
Ackee
 
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
Ackee
 
TRAX technical highlights
TRAX technical highlightsTRAX technical highlights
TRAX technical highlights
ESUG
 
S60 3rd FP2 Widgets
S60 3rd FP2 WidgetsS60 3rd FP2 Widgets
S60 3rd FP2 Widgets
romek
 
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
Ackee
 
React native introduction
React native introductionReact native introduction
React native introduction
InnerFood
 
ReactJs
ReactJsReactJs
[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
Kobkrit Viriyayudhakorn
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
Jalpesh Vadgama
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jamal Sinclair O'Garro
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick Sutterer
Pivorak MeetUp
 
Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integration
dfeyer
 

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 diari
Anna 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
 
React a11y-csun
React a11y-csunReact a11y-csun
React a11y-csun
Poonam Tathavadkar
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
"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
Fwdays
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jquery
duygut
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
William Myers
 
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
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
University of Catania
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeople
SpringPeople
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
daniel 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 Interface
Alfresco Software
 
Mail Merge Documents With Aspnet
Mail Merge Documents With AspnetMail Merge Documents With Aspnet
Mail Merge Documents With Aspnet
James Johnson
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
DayNightGaMiNg
 
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
NitinShelake4
 
Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011Scott Schuster Portfolio 04262011
Scott Schuster Portfolio 04262011
schusco12
 
Online test management system
Online test management systemOnline test management system
Online test management system
Prateek Agarwak
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
DayNightGaMiNg
 

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

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

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