SlideShare a Scribd company logo
Unobtrusive Javascript with jQueryPresentationbyAngel Ruiz Calvo
SummaryJavascript frameworksjQuery introductionUnobtrusive JavascriptLessons learnedWorking examplesThanks & Acknowledgements.
Why areJavascript frameworks needed?
Why areJavascript frameworks needed?Because this is how Javascript is seen by the browser:
Javascript frameworksTheir main aim is to present a solid and usable API on top of Javascript  while at the same time it hides painful browser particularities and incompatibilities.Essential to make “cross-browser” web applications.Makes programming Javascript easier and simpler.There are a few available.
Javascript frameworksTheir main aim is to present a solid and usable API on top of Javascript  while at the same time it hides painful browser particularities and incompatibilities.Essential to make “cross-browser” web applications.Makes programming Javascript easier and simpler.There are a few available.
jQuerysuccessis about ...
jQuerysuccessis about ...Plugins
jQuerysuccessis about ...PluginsBig community
jQuerysuccessis about ...PluginsBig communityIndustry support...
jQuerysuccessis about ...PluginsBig communityIndustry support...Lightweight
jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeed
jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documented
jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documentedSupport
jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documentedSupportOpen/Free license
jQuery core philosophySimplify iteration between HTML and JavascriptFind HTML
jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to it
jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExample<HTML><BODY>	<DIV>This is</DIV>	<DIV>and example</DIV></BODY>	</HTML>
jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExampleFind all divs$(“DIV”);<HTML><BODY><DIV>This is</DIV><DIV>and example</DIV></BODY>	</HTML>
jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExampleFind all divsAdd class “foo” to all of them$(“DIV”).addClass(“foo”);<HTML><BODY><DIV class=“foo”>This is</DIV>	<DIV class=“foo”>and example</DIV></BODY>	</HTML>
jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”
jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows
jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with 				// “step”
jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with 				// “step”Or you can combine them:$(“#myID, .myClass, table”);
jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with 				// “step”Or you can combine them:$(“#myID, .myClass, table”);More examples:http://codylindley.com/jqueryselectors/
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...Ajaxget(), getJSON(), post(), ajax(), load(), ...
jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...Ajaxget(), getJSON(), post(), ajax(), load(), ...More...
jQuery Plug-insHere you can find everything you need:http://plugins.jquery.com/
jQuery Plug-insHere you can find everything you need:http://plugins.jquery.com/Well known plug-in libraries:http://flowplayer.org/tools/index.htmlhttp://jqueryui.com/
jQuery referencesThe main documentation site is the best reference:http://docs.jquery.com
jQuery referencesThe main documentation site is the best reference:http://docs.jquery.comTo get up to speed we have purchased this book:
Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:
Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).
Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).Follow best practises to avoid each browser particular issues.
Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).Follow best practises to avoid each browser particular issues.“Progressive Enhancement” instead of “Graceful degradation”.
Separate behaviour from structure (mark-up).Before:<HTML><BODY>	<INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY>	</HTML>
Separate behaviour from structure (mark-up).Before:After:<HTML><BODY>	<INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY>	</HTML><HTML><BODY>	<INPUT type=“button”></BODY><script type=“text/javascript”>	$(“INPUT”).click(function(){alert(‘Hello World’);});</script></HTML>
Separate behaviour from structure (mark-up).Before:After:<HTML><BODY>	<INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY>	</HTML>Don’t worry!!Experience will show you that IT GETS BETTER THAN THAT!!!<HTML><BODY>	<INPUT type=“button”></BODY><script type=“text/javascript”>	$(“INPUT”).click(function(){alert(‘Hello World’);});</script></HTML>
Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.
Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!
Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?
Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?
Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?Good examples of CSS frameworks:YAML:http://www.yaml.de/en/Blueprint: http://www.blueprintcss.org/
“Graceful Degradation”e.g. Date PickerRenders both input field and buttonIf javascript is disabledthe button will not work
“Progressive Enhancement”e.g. Date PickerRenders both input field and hides buttonIf javascript is enabledthe button will be shown
Lessons learnedCss at the top.
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:$(function (){  //code will execute after page load}),
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:$(function (){  //code will execute after page load}),$(document).ready(function (){});
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:,                  , your “best friend”.$(function (){  //code will execute after page load}),$(document).ready(function (){});
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:,                  , your “best friend”.Group, minify and gzip these static resources:$(function (){  //code will execute after page load}),$(document).ready(function (){});
Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:,                  , your “best friend”.Group, minify and gzip these static resources:Asses your page using YslowYou do not need to score 100.Try to follow the suggested best practices as much as possible.$(function (){  //code will execute after page load}),$(document).ready(function (){});
Any questions before showing working examples?
Thanks for listeningThe authorAngel Ruiz is an IT Senior Consultant at SRA IT (Australia)AcknowledgmentsIgnacio Coloma from ExtremaSistemas (Spain)
Ad

More Related Content

What's hot (20)

jQuery
jQueryjQuery
jQuery
Dileep Mishra
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
Gil Fink
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
Doug Neiner
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
NexThoughts Technologies
 
jQuery
jQueryjQuery
jQuery
Mostafa Bayomi
 
jQuery
jQueryjQuery
jQuery
Vishwa Mohan
 
The jQuery Library
The  jQuery LibraryThe  jQuery Library
The jQuery Library
LearnNowOnline
 
jQuery Introduction
jQuery IntroductionjQuery Introduction
jQuery Introduction
Arwid Bancewicz
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Zeeshan Khan
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
Karol Depka Pradzinski
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
Simon Willison
 
FuncUnit
FuncUnitFuncUnit
FuncUnit
Brian Moschel
 
Nothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive WebNothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive Web
colinbdclark
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
colinbdclark
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Gunjan Kumar
 
Organizing Code with JavascriptMVC
Organizing Code with JavascriptMVCOrganizing Code with JavascriptMVC
Organizing Code with JavascriptMVC
Thomas Reynolds
 
jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');
mikehostetler
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
Gil Fink
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
Doug Neiner
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Zeeshan Khan
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
Simon Willison
 
Nothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive WebNothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive Web
colinbdclark
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
colinbdclark
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Gunjan Kumar
 
Organizing Code with JavascriptMVC
Organizing Code with JavascriptMVCOrganizing Code with JavascriptMVC
Organizing Code with JavascriptMVC
Thomas Reynolds
 
jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');jQuery('#knowledge').appendTo('#you');
jQuery('#knowledge').appendTo('#you');
mikehostetler
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 

Similar to Unobtrusive javascript with jQuery (20)

Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
Allegient
 
J query training
J query trainingJ query training
J query training
FIS - Fidelity Information Services
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
Marc Grabanski
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
guest5d87aa6
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
Marc Grabanski
 
jQuery
jQueryjQuery
jQuery
Ivano Malavolta
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
iFour Institute - Sustainable Learning
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
Jack Franklin
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
kolkatageeks
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
Alan Hecht
 
JQuery do dia-a-dia Gustavo Dutra
JQuery do dia-a-dia Gustavo DutraJQuery do dia-a-dia Gustavo Dutra
JQuery do dia-a-dia Gustavo Dutra
Tchelinux
 
jQuery - Introdução
jQuery - IntroduçãojQuery - Introdução
jQuery - Introdução
Gustavo Dutra
 
jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
dmethvin
 
The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
QConLondon2008
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Doris Chen
 
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
careersblog
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
Allegient
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
guest5d87aa6
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
 
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
Jack Franklin
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
kolkatageeks
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
Alan Hecht
 
JQuery do dia-a-dia Gustavo Dutra
JQuery do dia-a-dia Gustavo DutraJQuery do dia-a-dia Gustavo Dutra
JQuery do dia-a-dia Gustavo Dutra
Tchelinux
 
jQuery - Introdução
jQuery - IntroduçãojQuery - Introdução
jQuery - Introdução
Gustavo Dutra
 
jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
dmethvin
 
The Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J QueryThe Dom Scripting Toolkit J Query
The Dom Scripting Toolkit J Query
QConLondon2008
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Doris Chen
 
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
careersblog
 
Ad

Recently uploaded (20)

Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Ad

Unobtrusive javascript with jQuery

  • 1. Unobtrusive Javascript with jQueryPresentationbyAngel Ruiz Calvo
  • 2. SummaryJavascript frameworksjQuery introductionUnobtrusive JavascriptLessons learnedWorking examplesThanks & Acknowledgements.
  • 4. Why areJavascript frameworks needed?Because this is how Javascript is seen by the browser:
  • 5. Javascript frameworksTheir main aim is to present a solid and usable API on top of Javascript while at the same time it hides painful browser particularities and incompatibilities.Essential to make “cross-browser” web applications.Makes programming Javascript easier and simpler.There are a few available.
  • 6. Javascript frameworksTheir main aim is to present a solid and usable API on top of Javascript while at the same time it hides painful browser particularities and incompatibilities.Essential to make “cross-browser” web applications.Makes programming Javascript easier and simpler.There are a few available.
  • 10. jQuerysuccessis about ...PluginsBig communityIndustry support...
  • 11. jQuerysuccessis about ...PluginsBig communityIndustry support...Lightweight
  • 12. jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeed
  • 13. jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documented
  • 14. jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documentedSupport
  • 15. jQuerysuccessis about ...PluginsBig communityIndustry support...LightweightSpeedWell documentedSupportOpen/Free license
  • 16. jQuery core philosophySimplify iteration between HTML and JavascriptFind HTML
  • 17. jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to it
  • 18. jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExample<HTML><BODY> <DIV>This is</DIV> <DIV>and example</DIV></BODY> </HTML>
  • 19. jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExampleFind all divs$(“DIV”);<HTML><BODY><DIV>This is</DIV><DIV>and example</DIV></BODY> </HTML>
  • 20. jQuery core philosophySimplify iteration between HTML and JavascriptFind HTMLDo something to itExampleFind all divsAdd class “foo” to all of them$(“DIV”).addClass(“foo”);<HTML><BODY><DIV class=“foo”>This is</DIV> <DIV class=“foo”>and example</DIV></BODY> </HTML>
  • 21. jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”
  • 22. jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows
  • 23. jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with // “step”
  • 24. jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with // “step”Or you can combine them:$(“#myID, .myClass, table”);
  • 25. jQuery factory method $()Its argument is always a CSS selector (CSS3 support for 1.4+ versions).Examples:$(“#myID”);// get element with id=“myID”$(“.myClass”);// get elements with class name=“myClass”$(“li:first”);// get first list item$(“tr:odd”);// get odd table rows$(“a[target=_blank]”);// get all links whose target is “_blank”$(“form[id^=step]”);// get all forms whose id begins with // “step”Or you can combine them:$(“#myID, .myClass, table”);More examples:http://codylindley.com/jqueryselectors/
  • 26. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...
  • 27. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...
  • 28. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...
  • 29. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...
  • 30. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...
  • 31. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...Ajaxget(), getJSON(), post(), ajax(), load(), ...
  • 32. jQuery API groupsMoving elementsbefore(), after(), appendTo(), append(), ...Attributescss(), attr(), html(), val(), addClass(), ...Eventsbind(), trigger(), unbind(), live(), click(), ...Effectsshow(), fadeOut(), toogle(), animate(), ...Traversingfind(), is(), prevAll(), next(), hasClass(), ...Ajaxget(), getJSON(), post(), ajax(), load(), ...More...
  • 33. jQuery Plug-insHere you can find everything you need:http://plugins.jquery.com/
  • 34. jQuery Plug-insHere you can find everything you need:http://plugins.jquery.com/Well known plug-in libraries:http://flowplayer.org/tools/index.htmlhttp://jqueryui.com/
  • 35. jQuery referencesThe main documentation site is the best reference:http://docs.jquery.com
  • 36. jQuery referencesThe main documentation site is the best reference:http://docs.jquery.comTo get up to speed we have purchased this book:
  • 37. Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:
  • 38. Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).
  • 39. Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).Follow best practises to avoid each browser particular issues.
  • 40. Unobtrusive JavascriptIt is a design paradigm for the web presentation layer (DHTML = HTML + CSS + Javascript) whose basic principles are:Separate behaviour from structure (mark-up).Follow best practises to avoid each browser particular issues.“Progressive Enhancement” instead of “Graceful degradation”.
  • 41. Separate behaviour from structure (mark-up).Before:<HTML><BODY> <INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY> </HTML>
  • 42. Separate behaviour from structure (mark-up).Before:After:<HTML><BODY> <INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY> </HTML><HTML><BODY> <INPUT type=“button”></BODY><script type=“text/javascript”> $(“INPUT”).click(function(){alert(‘Hello World’);});</script></HTML>
  • 43. Separate behaviour from structure (mark-up).Before:After:<HTML><BODY> <INPUT type=“button” onclick=“alert(‘Hello World’);”></BODY> </HTML>Don’t worry!!Experience will show you that IT GETS BETTER THAN THAT!!!<HTML><BODY> <INPUT type=“button”></BODY><script type=“text/javascript”> $(“INPUT”).click(function(){alert(‘Hello World’);});</script></HTML>
  • 44. Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.
  • 45. Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!
  • 46. Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?
  • 47. Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?
  • 48. Follow best practises to avoid each browser particularaties.Basically use jQuery for your javascript.But do not forget about CSS frameworks!!!Why?Good examples of CSS frameworks:YAML:http://www.yaml.de/en/Blueprint: http://www.blueprintcss.org/
  • 49. “Graceful Degradation”e.g. Date PickerRenders both input field and buttonIf javascript is disabledthe button will not work
  • 50. “Progressive Enhancement”e.g. Date PickerRenders both input field and hides buttonIf javascript is enabledthe button will be shown
  • 52. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).
  • 53. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:$(function (){ //code will execute after page load}),
  • 54. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:$(function (){ //code will execute after page load}),$(document).ready(function (){});
  • 55. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:, , your “best friend”.$(function (){ //code will execute after page load}),$(document).ready(function (){});
  • 56. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:, , your “best friend”.Group, minify and gzip these static resources:$(function (){ //code will execute after page load}),$(document).ready(function (){});
  • 57. Lessons learnedCss at the top.Javascript at the bottom (not always, e.g. jQuery import).Or remember:which is equivalent to:, , your “best friend”.Group, minify and gzip these static resources:Asses your page using YslowYou do not need to score 100.Try to follow the suggested best practices as much as possible.$(function (){ //code will execute after page load}),$(document).ready(function (){});
  • 58. Any questions before showing working examples?
  • 59. Thanks for listeningThe authorAngel Ruiz is an IT Senior Consultant at SRA IT (Australia)AcknowledgmentsIgnacio Coloma from ExtremaSistemas (Spain)