SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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

Notas do Editor

  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