SlideShare a Scribd company logo
Getting started with
jQuery
Gill Cleeren
@gillcleeren
Hi, I‟m Gill!
Gill Cleeren
MVP and Regional Director
.NET Architect @ Ordina
Trainer & speaker
@gillcleeren
gill@snowball.be
What we‟ll be looking at...
• Why jQuery?
• jQuery fundamentals
• Creating and manipulating elements
• Events
• Animations and effects
• Talking to the server
• jQuery UI
• Writing plugins
• Breaking news around new releases
• Using the CDN
Throughout the session...
•You‟ll see some
•Goal: show a particular place where jQuery really
stands out
Hi, jQuery
• jQuery is
• Most popular, cross-browser JavaScript library
• Focusing on making client-side scripting of HTML simpler
• Easy navigating the DOM
• Handling events
• Working with Ajax
• Open-source, first released in 2006
• Current release is 1.9 and 2.1
• Same API
• 2.X branch doesn‟t support IE 6, 7 and 8
– Recommended to use 1.X for public sites
Why jQuery?
• Many JavaScript frameworks try bending the language out
of its natural form
• jQuery aims at leveraging CSS, HTML and JavaScript
• Advantages
• Lightweight
• Easy to learn using familiar CSS syntax and intuitive
• Many plugins available
• Easy to extend and compatible
• It‟s on Microsoft‟s radar
• Rich community
$('#something').hide().css('background', 'red').fadeIn();
You are not alone!
• Many LARGE companies use jQuery for their sites, including:
Microsoft and jQuery
•Included with Visual Studio in both WebForms
and MVC projects for a couple of versions already
• Can be used with or without ScriptManager
• IntelliSense available
• CDN support (more later)
•Microsoft is contributor to jQuery
• Created templating, data linking and globalization (2010)
• Not actively maintained now though
Script, don‟t get in my way!
• jQuery helps us writing Unobstrutive JavaScript code
• You don‟t want to mingle style with HTML
• Why would you want to mingle behavior with HTML?
• This will become a heavy job without jQuery!
jQuery fundamentals: $
•$ function (aka jQuery() function) returns
• A JavaScript object containing an array of DOM elements
• In the order they were found in the document
• Matching a specified selector (for example a CSS selector)
• Known to mankind as a wrapper or wrapped set
•It returns the same group of elements, can be
chained
jQuery fundamentals: the ready handler
• Script execution should wait until DOM elements are
ready
• You say: window.onload?
• Sadly, this waits for everything to be loaded, including images etc
• Script execution is too late
• Instead, we need to wait only until the DOM tree is
created
• Can be difficult in cross-browser situations
• Easy-peasy with jQuery
jQuery fundamentals: selectors
•At the core of jQuery lies its selector engine
• Can be used to select elements based on
names, attribute, position...
•$() is heavily overloaded
• Making a selection
• Creating new HTML elements
jQuery fundamentals: selectors
•Most basic: CSS selectors
• Can be combined
•Child selector
•Attribute selector
jQuery fundamentals: selectors
•Position
•Psuedo-classes (CSS filter selectors & custom
selectors)
More selectors
Full list at http://www.w3.org/TR/css3-
selectors/Pattern Meaning
* any element
E an element of type E
E[foo] an E element with a "foo" attribute
E[foo^="bar"]
an E element whose "foo" attribute value begins exactly
with the string "bar"
E:nth-child(n) an E element, the n-th child of its parent
E:first-child an E element, first child of its parent
E:empty an E element that has no children (including text nodes)
E:link
E:visited
an E element being the source anchor of a hyperlink of
which the target is not yet visited (:link) or already visited
(:visited)
E > F an F element child of an E element
E + F an F element immediately preceded by an E element
DEMO
Selecting elements using selectors
jQuery fundamentals: creating elements
•$(„...‟) selects an element <> $(„<li>‟) creates an
element
• Attributes can be passed using JavaScript object
DEMO
Creating elements using $
Working with the result of $
•Once we have a wrapped set, we can go wild with
it!
• Handle the set as a whole
• Work with individual elements
Working with the result of $
•A wrapped set is like an array of elements, normal
“array operations” can be done on it
• Check the size
• Access an indiviual element
• Loop over the elements
Working with the result of $
•Set operations (continued)
• Add and remove elements
• Filter elements
•Remember that we are always returning the set
• Chaining is always possible!
DEMO
Working with the set
Attributes
• When we want to change how an element looks, we
can change its attributes
• jQuery provides the attr() method
• 2 variations based on number and types of parameters
• Read a specified property from first element in wrapped set
• Set a property on all elements in the wrapped set (0 or more)
– Can also accept a function
• Attr() helps us dealing with browser-dependencies
(again)
• jQuery float attribute refers to styleFloat in IE, cssFloat in others
Attributes (2)
•jQuery makes it easy to apply and remove CSS
classes
• addClass(), removeClass(), toggleClass() and hasClass()
•Changing indiviual CSS elements is supported
• css() can be used to get or set CSS on an element$('#mydiv').css("background-color","yellow");
Working with elements
•html() can be used to get or set the content of an
element
• text() can retrieve combined textual content of all
elements, including their children
•If the elements are form elements, we need to use
val()
$('input:checkbox:checked').val();
$('#mydiv').html();
DEMO
Working with attributes
Events
• A bit of history
• Once upon a time, a browser called Netscape introduced an event
model, often referred to as DOM Level 0 Event Model
• Creates event handlers as references to a function on a property
• Not what we need if we want to create Unobtrusive JavaScript
• Only one event handler per element for specific event
• Only got standardized until DOM Level 2 Event Model
• Based on a system of event listeners (addEventListener)
• IE decided to go its own way (attachEvent)
• Using event was a real mess because of browser dependencies
• jQuery comes to the rescue
jQuery events
•on() is where it all starts
• Binds a function to any event on any DOM element
• off() can be used to unbind a function from an event
• Replaces the bind() and unbind()
• Works in any browser, jQuery hides the details for us
• Possible to bind more than one event handler for an event on
on element
•one() removes itself after event handler executed
DEMO
Events
Animations and effects
• Core jQuery has some basic effects
• More are available in jQuery UI
• Should be used with caution!
• Most basic „animation‟ is hiding/showing an element
• hide(): sets display:none on the element
• show(): sets display to inline/block
• toggle(): sets visible is hidden and vice-versa
• Methods are overloaded, accepting
• Speed
• Callback
Animations and effects (2)
•Elements can also be gradually added/removed
• slideDown() and slideUp()
•Fading in is supported as well
• fadeIn() and fadeOut()
•animate() is mother of all animations
• Using „target values‟ for style properties, jQuery will animate the
transition
DEMO
Animations
Ajax in the past
• When we were all young (in 1998), Microsoft introduced the ability to
perform asynchronous requests from script (ActiveX)
• Later, other browsers implemented a standard, the XMLHttpRequest
• IE6 uses an ActiveX object
• Result is that we need to do checks
• Again... jQuery to the rescue!
if(window.ActiveXObject) {
xhr = new
ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}
Ajax with jQuery
• Basic functionality to load content from a server-side
resource:
• load()
• url
• parameters: data to be passed (string, object...). If provided, a POST is
executed, otherwise a GET
• callback (optional)
• Next to load, we can also use $.get()/$.getJson() or $.post()
$('#someDiv')
.load('test.html',
function() {
alert('Load was performed.');
});
DEMO
Basic Ajax request with load()
Ajax with jQuery
•If we need all control over the Ajax request we
can get:
• $.ajax()
• options: defines an object containing all the properties for the Ajax
request
•List of options is huge, therefore
• $.ajaxSetup
• options: defines an object containing all the properties for the Ajax
request, becoming the default for Ajax requests
Ajax with jQuery
•Throughout the Ajax request, we can get
feedback
• Local events from the $.ajax() call (callbacks)
• Global events
• Are broadcast to every element within the DOM, can be attached on
any element
– ajaxStart
– ajaxSend
– ajaxSuccess
– ajaxError
– ajaxComplete
DEMO
More control with ajax()
jQuery Ajax, ASP.NET MVC and WebForms
•jQuery can work in harmony with ASP.NET MVC
and WebForms
• Sample ajax() call for WebForms
$.ajax({
type: "post",
contentType: "application/json; charset=utf-8",
dataType: "json",
url: "/Default.aspx/AddTask",
data: JSON.stringify(dto)
});
DEMO
ASP.NET WebForms with jQuery
DEMO
ASP.NET MVC with jQuery
jQuery UI
• Huge extension of jQuery, providing more UI capabilities
• Contains number of UI features we‟d logically need
• Includes
• Effects: more advanced than core effects
• Interactions: drag and drop
• Widgets (aka controls): date picker...
• All can be themed
• jqueryui.com contains tool to configure download and
“ThemeRoller” tool
• Code included in jquery-ui.js
jQueryUI Themes
•Themes come with the download
• It‟s *never* going to be OK for the marketing guys!
• Options
• Use it anyway
• Use the ThemeRoller
• Tweak a default or custom-created one
• Create one yourself (Warning: the CSS is quite large)
Effects
• jQuery core contains some basic effects
• Based on the effect(type, options, speed, callback) method
• Has several animation types such as puff, highlight and shake (even
explode exists)
• Also allows to do animations with colors (not possible with animate())
• backgroundColor, color...
• Visibility methods (show()...) are extended
• Class methods (addClass()...) are extended
• position() method is added for
advanced positioning
$('#someElement').position({
my: 'top center',
at: 'bottom right',
of: '#someOtherElement'});
DEMO
Effects
Interactions
• Interactions focus on allowing users to directly interact
with elements, which isn‟t possible with standard
HTML controls
• They add advanced behaviors to our pages related to mouse
interactions
• Available interactions:
• Dragging
• Dropping
• Sorting
• Resizing
• Selecting
Dragging
•Easy-peasy (again) with jQuery
•draggable() is your friend (heavily overloaded
once again)
• Allows making elements draggable, possible with options
(opacity...)
• Overloaded so it also support enabling, disabling... Draggable
DEMO
Dragging, dropping
and other interactions
Widgets: controls on steroids
• New controls (based on existing ones)
• Contents
• Buttons
• Sliders
• Progress bars
• Autocompletion
• Date picker
• Tabs
• Accordion
• Dialog box
Date picker
•Have you noticed that entering dates is a difficult
thing for end users? Some will always get it
wrong!
•jQuery UI‟s DatePicker can help
• $.datepicker() creates the control for you
• Has numerous options, mostly default will do
• $.datepicker.setDefaults() can be used to share defaults
Dialog Box
• In fact, a dialog box is nothing more that a DIV with a higher
z-index and some custom chrome
• jQuery will handle the nasty details for us (once again)
• About every element can become the content of the dialog
box
• On a wrapped set, use .dialog() to make it appear as such
• Triggers some events, such as close, drag and resize
• Adds classes on the elements
• ui-dialog
• ui-dialog-title
• ...
DEMO
Widgets in action
Something missing in jQuery?
•2 options:
• Use an existing plugin
• jQuery plugin repository: plugins.jquery.com
• Google code: code.google.com
• SourceForge: sourceforge.net
• GitHub: github.com
• Write a plugin yourself
• Custom utility function
• Create wrapper functions
DEMO
Using a plugin
Writing your own plugins
•Write a plugin to add it yourself!
• Possible to write your own utility functions and wrapper
methods
•Creating new wrapper methods:
• Add the method as a property on the fn object in the $
namespace
DEMO
Writing a plugin
Where to get your stuff?
•Use a CDN?
• Microsoft
• Google
•Put scripts locally as well with a fallback
mechanism<script type="text/javascript"
src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js">
</script>
<script type="text/javascript">
if (typeof jQuery == 'undefined')
{
document.write(unescape("%3Cscript src='/Scripts/jquery-1.4.2.min.js'
type='text/javascript'%3E%3C/script%3E"));
}
</script>
Summary
•Where does all the (l) for jQuery come from?
• Light-weight library that uses JavaScript as JavaScript, relying
on CSS
• Cross-browser compatible, hides the details (ready handler)
• Easy eventing model
• Can work with MVC & WebForms
• Easily extensible to fit your needs, tons of plugins already
available
So I hope you now say too...
Questions?
Thank you!
Getting started with
jQuery
Gill Cleeren
@gillcleeren

More Related Content

What's hot (20)

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
 
Javascript libraries
Javascript librariesJavascript libraries
Javascript libraries
Dumindu Pahalawatta
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
J query module1
J query module1J query module1
J query module1
Srivatsan Krishnamachari
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Siva Arunachalam
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
Karol Depka Pradzinski
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
Angel Ruiz
 
Jquery
JqueryJquery
Jquery
Girish Srivastava
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
James Johnson
 
The jQuery Library
The  jQuery LibraryThe  jQuery Library
The jQuery Library
LearnNowOnline
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
colinbdclark
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
Tomi Juhola
 
J query presentation
J query presentationJ query presentation
J query presentation
akanksha17
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
dmethvin
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
Remy Sharp
 
jQuery
jQueryjQuery
jQuery
Dileep Mishra
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
Bedis ElAchèche
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson
 
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
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
Angel Ruiz
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
colinbdclark
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
Tomi Juhola
 
J query presentation
J query presentationJ query presentation
J query presentation
akanksha17
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
dmethvin
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
Remy Sharp
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
Rod Johnson
 

Similar to Getting started with jQuery (20)

A to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperA to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginners
Isfand yar Khan
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
Laila Buncab
 
J query training
J query trainingJ query training
J query training
FIS - Fidelity Information Services
 
J query presentation
J query presentationJ query presentation
J query presentation
sawarkar17
 
Web technologies-course 11.pptx
Web technologies-course 11.pptxWeb technologies-course 11.pptx
Web technologies-course 11.pptx
Stefan Oprea
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
Knoldus Inc.
 
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_and_Ajax.pptx
JQuery_and_Ajax.pptxJQuery_and_Ajax.pptx
JQuery_and_Ajax.pptx
AditiPawale1
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
orestJump
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
careersblog
 
jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
jeresig
 
J query
J queryJ query
J query
Ramakrishna kapa
 
A Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETA Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
Everything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQueryEverything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQuery
Dave Ross
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Seble Nigussie
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
azz71
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
A to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java DeveloperA to Z about JQuery - Become Newbie to Expert Java Developer
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginners
Isfand yar Khan
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
Laila Buncab
 
J query presentation
J query presentationJ query presentation
J query presentation
sawarkar17
 
Web technologies-course 11.pptx
Web technologies-course 11.pptxWeb technologies-course 11.pptx
Web technologies-course 11.pptx
Stefan Oprea
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
Knoldus Inc.
 
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_and_Ajax.pptx
JQuery_and_Ajax.pptxJQuery_and_Ajax.pptx
JQuery_and_Ajax.pptx
AditiPawale1
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
orestJump
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
Jqueryforbeginnersjqueryconference2009 090914063709 Phpapp02
careersblog
 
jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
jeresig
 
A Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NETA Rich Web experience with jQuery, Ajax and .NET
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
Everything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQueryEverything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQuery
Dave Ross
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Seble Nigussie
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
azz71
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 

More from Gill Cleeren (13)

Continuous integration and delivery with Xamarin and VSTS
Continuous integration and delivery with Xamarin and VSTSContinuous integration and delivery with Xamarin and VSTS
Continuous integration and delivery with Xamarin and VSTS
Gill Cleeren
 
Real world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVMReal world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVM
Gill Cleeren
 
Hello windows 10
Hello windows 10Hello windows 10
Hello windows 10
Gill Cleeren
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using Xamarin
Gill Cleeren
 
Building your first android app using Xamarin
Building your first android app using XamarinBuilding your first android app using Xamarin
Building your first android app using Xamarin
Gill Cleeren
 
Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overview
Gill Cleeren
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
Gill Cleeren
 
Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014
Gill Cleeren
 
C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform development
Gill Cleeren
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 features
Gill Cleeren
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!
Gill Cleeren
 
Why you shouldn't dismiss windows 8 for your lob apps
Why you shouldn't dismiss windows 8 for your lob appsWhy you shouldn't dismiss windows 8 for your lob apps
Why you shouldn't dismiss windows 8 for your lob apps
Gill Cleeren
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
Gill Cleeren
 
Continuous integration and delivery with Xamarin and VSTS
Continuous integration and delivery with Xamarin and VSTSContinuous integration and delivery with Xamarin and VSTS
Continuous integration and delivery with Xamarin and VSTS
Gill Cleeren
 
Real world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVMReal world apps with Xamarin and MVVM
Real world apps with Xamarin and MVVM
Gill Cleeren
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using Xamarin
Gill Cleeren
 
Building your first android app using Xamarin
Building your first android app using XamarinBuilding your first android app using Xamarin
Building your first android app using Xamarin
Gill Cleeren
 
Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overview
Gill Cleeren
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
Gill Cleeren
 
Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014Building a community - BuildStuff Lithuania 2014
Building a community - BuildStuff Lithuania 2014
Gill Cleeren
 
C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform development
Gill Cleeren
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 features
Gill Cleeren
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!
Gill Cleeren
 
Why you shouldn't dismiss windows 8 for your lob apps
Why you shouldn't dismiss windows 8 for your lob appsWhy you shouldn't dismiss windows 8 for your lob apps
Why you shouldn't dismiss windows 8 for your lob apps
Gill Cleeren
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
Gill Cleeren
 

Recently uploaded (20)

ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
officeiqai
 
system-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdfsystem-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdf
Tof Abdu
 
Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?
Petar Radanliev
 
Validationapproach for sap data -.pptx
Validationapproach for sap  data  -.pptxValidationapproach for sap  data  -.pptx
Validationapproach for sap data -.pptx
aichannellsh
 
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
BradBedford3
 
And overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applicationsAnd overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applications
Pavel Vlasov
 
arvr & metaverse development services.pdf
arvr & metaverse development services.pdfarvr & metaverse development services.pdf
arvr & metaverse development services.pdf
marketing810348
 
Intranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We WorkIntranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We Work
BizPortals Solutions
 
Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan
OnePlan Solutions
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
Lightworks PRO 2025.1 Crack Free Download
Lightworks PRO 2025.1 Crack Free DownloadLightworks PRO 2025.1 Crack Free Download
Lightworks PRO 2025.1 Crack Free Download
Berkeley
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Menu in Android (Define,Create,Inflate and Click Handler)
Menu in Android (Define,Create,Inflate and Click Handler)Menu in Android (Define,Create,Inflate and Click Handler)
Menu in Android (Define,Create,Inflate and Click Handler)
Nabin Dhakal
 
Microsoft Defender para ponto de extremidade
Microsoft Defender para ponto de extremidadeMicrosoft Defender para ponto de extremidade
Microsoft Defender para ponto de extremidade
leotcerveira
 
Understanding software requirements chapter 5
Understanding software requirements chapter 5Understanding software requirements chapter 5
Understanding software requirements chapter 5
MaheenVohra
 
Chapter_02.pdf Software process Models.pdf
Chapter_02.pdf Software process Models.pdfChapter_02.pdf Software process Models.pdf
Chapter_02.pdf Software process Models.pdf
MaheenVohra
 
LightBurn 1.7.0.6 + Crack Download🔓
LightBurn  1.7.0.6  +  Crack  Download🔓LightBurn  1.7.0.6  +  Crack  Download🔓
LightBurn 1.7.0.6 + Crack Download🔓
Berkeley
 
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
officeiqai
 
system-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdfsystem-and-network-administration pptx-.pdf
system-and-network-administration pptx-.pdf
Tof Abdu
 
Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?Frontier AI Regulation: What form should it take?
Frontier AI Regulation: What form should it take?
Petar Radanliev
 
Validationapproach for sap data -.pptx
Validationapproach for sap  data  -.pptxValidationapproach for sap  data  -.pptx
Validationapproach for sap data -.pptx
aichannellsh
 
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025
BradBedford3
 
And overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applicationsAnd overview of Nasdanika Models and their applications
And overview of Nasdanika Models and their applications
Pavel Vlasov
 
arvr & metaverse development services.pdf
arvr & metaverse development services.pdfarvr & metaverse development services.pdf
arvr & metaverse development services.pdf
marketing810348
 
Intranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We WorkIntranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We Work
BizPortals Solutions
 
Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan
OnePlan Solutions
 
Top 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdfTop 5 Odoo Modules for the EPC Industry.pdf
Top 5 Odoo Modules for the EPC Industry.pdf
SatishKumar2651
 
Key Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker SoftwareKey Characteristics of High-Performing Insurance Broker Software
Key Characteristics of High-Performing Insurance Broker Software
Insurance Tech Services
 
Lightworks PRO 2025.1 Crack Free Download
Lightworks PRO 2025.1 Crack Free DownloadLightworks PRO 2025.1 Crack Free Download
Lightworks PRO 2025.1 Crack Free Download
Berkeley
 
Top 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdfTop 10 Mobile Banking Apps in the USA.pdf
Top 10 Mobile Banking Apps in the USA.pdf
LL Technolab
 
Menu in Android (Define,Create,Inflate and Click Handler)
Menu in Android (Define,Create,Inflate and Click Handler)Menu in Android (Define,Create,Inflate and Click Handler)
Menu in Android (Define,Create,Inflate and Click Handler)
Nabin Dhakal
 
Microsoft Defender para ponto de extremidade
Microsoft Defender para ponto de extremidadeMicrosoft Defender para ponto de extremidade
Microsoft Defender para ponto de extremidade
leotcerveira
 
Understanding software requirements chapter 5
Understanding software requirements chapter 5Understanding software requirements chapter 5
Understanding software requirements chapter 5
MaheenVohra
 
Chapter_02.pdf Software process Models.pdf
Chapter_02.pdf Software process Models.pdfChapter_02.pdf Software process Models.pdf
Chapter_02.pdf Software process Models.pdf
MaheenVohra
 
LightBurn 1.7.0.6 + Crack Download🔓
LightBurn  1.7.0.6  +  Crack  Download🔓LightBurn  1.7.0.6  +  Crack  Download🔓
LightBurn 1.7.0.6 + Crack Download🔓
Berkeley
 

Getting started with jQuery

  • 1. Getting started with jQuery Gill Cleeren @gillcleeren
  • 2. Hi, I‟m Gill! Gill Cleeren MVP and Regional Director .NET Architect @ Ordina Trainer & speaker @gillcleeren gill@snowball.be
  • 3. What we‟ll be looking at... • Why jQuery? • jQuery fundamentals • Creating and manipulating elements • Events • Animations and effects • Talking to the server • jQuery UI • Writing plugins • Breaking news around new releases • Using the CDN
  • 4. Throughout the session... •You‟ll see some •Goal: show a particular place where jQuery really stands out
  • 5. Hi, jQuery • jQuery is • Most popular, cross-browser JavaScript library • Focusing on making client-side scripting of HTML simpler • Easy navigating the DOM • Handling events • Working with Ajax • Open-source, first released in 2006 • Current release is 1.9 and 2.1 • Same API • 2.X branch doesn‟t support IE 6, 7 and 8 – Recommended to use 1.X for public sites
  • 6. Why jQuery? • Many JavaScript frameworks try bending the language out of its natural form • jQuery aims at leveraging CSS, HTML and JavaScript • Advantages • Lightweight • Easy to learn using familiar CSS syntax and intuitive • Many plugins available • Easy to extend and compatible • It‟s on Microsoft‟s radar • Rich community $('#something').hide().css('background', 'red').fadeIn();
  • 7. You are not alone! • Many LARGE companies use jQuery for their sites, including:
  • 8. Microsoft and jQuery •Included with Visual Studio in both WebForms and MVC projects for a couple of versions already • Can be used with or without ScriptManager • IntelliSense available • CDN support (more later) •Microsoft is contributor to jQuery • Created templating, data linking and globalization (2010) • Not actively maintained now though
  • 9. Script, don‟t get in my way! • jQuery helps us writing Unobstrutive JavaScript code • You don‟t want to mingle style with HTML • Why would you want to mingle behavior with HTML? • This will become a heavy job without jQuery!
  • 10. jQuery fundamentals: $ •$ function (aka jQuery() function) returns • A JavaScript object containing an array of DOM elements • In the order they were found in the document • Matching a specified selector (for example a CSS selector) • Known to mankind as a wrapper or wrapped set •It returns the same group of elements, can be chained
  • 11. jQuery fundamentals: the ready handler • Script execution should wait until DOM elements are ready • You say: window.onload? • Sadly, this waits for everything to be loaded, including images etc • Script execution is too late • Instead, we need to wait only until the DOM tree is created • Can be difficult in cross-browser situations • Easy-peasy with jQuery
  • 12. jQuery fundamentals: selectors •At the core of jQuery lies its selector engine • Can be used to select elements based on names, attribute, position... •$() is heavily overloaded • Making a selection • Creating new HTML elements
  • 13. jQuery fundamentals: selectors •Most basic: CSS selectors • Can be combined •Child selector •Attribute selector
  • 14. jQuery fundamentals: selectors •Position •Psuedo-classes (CSS filter selectors & custom selectors)
  • 15. More selectors Full list at http://www.w3.org/TR/css3- selectors/Pattern Meaning * any element E an element of type E E[foo] an E element with a "foo" attribute E[foo^="bar"] an E element whose "foo" attribute value begins exactly with the string "bar" E:nth-child(n) an E element, the n-th child of its parent E:first-child an E element, first child of its parent E:empty an E element that has no children (including text nodes) E:link E:visited an E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited) E > F an F element child of an E element E + F an F element immediately preceded by an E element
  • 17. jQuery fundamentals: creating elements •$(„...‟) selects an element <> $(„<li>‟) creates an element • Attributes can be passed using JavaScript object
  • 19. Working with the result of $ •Once we have a wrapped set, we can go wild with it! • Handle the set as a whole • Work with individual elements
  • 20. Working with the result of $ •A wrapped set is like an array of elements, normal “array operations” can be done on it • Check the size • Access an indiviual element • Loop over the elements
  • 21. Working with the result of $ •Set operations (continued) • Add and remove elements • Filter elements •Remember that we are always returning the set • Chaining is always possible!
  • 23. Attributes • When we want to change how an element looks, we can change its attributes • jQuery provides the attr() method • 2 variations based on number and types of parameters • Read a specified property from first element in wrapped set • Set a property on all elements in the wrapped set (0 or more) – Can also accept a function • Attr() helps us dealing with browser-dependencies (again) • jQuery float attribute refers to styleFloat in IE, cssFloat in others
  • 24. Attributes (2) •jQuery makes it easy to apply and remove CSS classes • addClass(), removeClass(), toggleClass() and hasClass() •Changing indiviual CSS elements is supported • css() can be used to get or set CSS on an element$('#mydiv').css("background-color","yellow");
  • 25. Working with elements •html() can be used to get or set the content of an element • text() can retrieve combined textual content of all elements, including their children •If the elements are form elements, we need to use val() $('input:checkbox:checked').val(); $('#mydiv').html();
  • 27. Events • A bit of history • Once upon a time, a browser called Netscape introduced an event model, often referred to as DOM Level 0 Event Model • Creates event handlers as references to a function on a property • Not what we need if we want to create Unobtrusive JavaScript • Only one event handler per element for specific event • Only got standardized until DOM Level 2 Event Model • Based on a system of event listeners (addEventListener) • IE decided to go its own way (attachEvent) • Using event was a real mess because of browser dependencies • jQuery comes to the rescue
  • 28. jQuery events •on() is where it all starts • Binds a function to any event on any DOM element • off() can be used to unbind a function from an event • Replaces the bind() and unbind() • Works in any browser, jQuery hides the details for us • Possible to bind more than one event handler for an event on on element •one() removes itself after event handler executed
  • 30. Animations and effects • Core jQuery has some basic effects • More are available in jQuery UI • Should be used with caution! • Most basic „animation‟ is hiding/showing an element • hide(): sets display:none on the element • show(): sets display to inline/block • toggle(): sets visible is hidden and vice-versa • Methods are overloaded, accepting • Speed • Callback
  • 31. Animations and effects (2) •Elements can also be gradually added/removed • slideDown() and slideUp() •Fading in is supported as well • fadeIn() and fadeOut() •animate() is mother of all animations • Using „target values‟ for style properties, jQuery will animate the transition
  • 33. Ajax in the past • When we were all young (in 1998), Microsoft introduced the ability to perform asynchronous requests from script (ActiveX) • Later, other browsers implemented a standard, the XMLHttpRequest • IE6 uses an ActiveX object • Result is that we need to do checks • Again... jQuery to the rescue! if(window.ActiveXObject) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); }
  • 34. Ajax with jQuery • Basic functionality to load content from a server-side resource: • load() • url • parameters: data to be passed (string, object...). If provided, a POST is executed, otherwise a GET • callback (optional) • Next to load, we can also use $.get()/$.getJson() or $.post() $('#someDiv') .load('test.html', function() { alert('Load was performed.'); });
  • 35. DEMO Basic Ajax request with load()
  • 36. Ajax with jQuery •If we need all control over the Ajax request we can get: • $.ajax() • options: defines an object containing all the properties for the Ajax request •List of options is huge, therefore • $.ajaxSetup • options: defines an object containing all the properties for the Ajax request, becoming the default for Ajax requests
  • 37. Ajax with jQuery •Throughout the Ajax request, we can get feedback • Local events from the $.ajax() call (callbacks) • Global events • Are broadcast to every element within the DOM, can be attached on any element – ajaxStart – ajaxSend – ajaxSuccess – ajaxError – ajaxComplete
  • 39. jQuery Ajax, ASP.NET MVC and WebForms •jQuery can work in harmony with ASP.NET MVC and WebForms • Sample ajax() call for WebForms $.ajax({ type: "post", contentType: "application/json; charset=utf-8", dataType: "json", url: "/Default.aspx/AddTask", data: JSON.stringify(dto) });
  • 42. jQuery UI • Huge extension of jQuery, providing more UI capabilities • Contains number of UI features we‟d logically need • Includes • Effects: more advanced than core effects • Interactions: drag and drop • Widgets (aka controls): date picker... • All can be themed • jqueryui.com contains tool to configure download and “ThemeRoller” tool • Code included in jquery-ui.js
  • 43. jQueryUI Themes •Themes come with the download • It‟s *never* going to be OK for the marketing guys! • Options • Use it anyway • Use the ThemeRoller • Tweak a default or custom-created one • Create one yourself (Warning: the CSS is quite large)
  • 44. Effects • jQuery core contains some basic effects • Based on the effect(type, options, speed, callback) method • Has several animation types such as puff, highlight and shake (even explode exists) • Also allows to do animations with colors (not possible with animate()) • backgroundColor, color... • Visibility methods (show()...) are extended • Class methods (addClass()...) are extended • position() method is added for advanced positioning $('#someElement').position({ my: 'top center', at: 'bottom right', of: '#someOtherElement'});
  • 46. Interactions • Interactions focus on allowing users to directly interact with elements, which isn‟t possible with standard HTML controls • They add advanced behaviors to our pages related to mouse interactions • Available interactions: • Dragging • Dropping • Sorting • Resizing • Selecting
  • 47. Dragging •Easy-peasy (again) with jQuery •draggable() is your friend (heavily overloaded once again) • Allows making elements draggable, possible with options (opacity...) • Overloaded so it also support enabling, disabling... Draggable
  • 49. Widgets: controls on steroids • New controls (based on existing ones) • Contents • Buttons • Sliders • Progress bars • Autocompletion • Date picker • Tabs • Accordion • Dialog box
  • 50. Date picker •Have you noticed that entering dates is a difficult thing for end users? Some will always get it wrong! •jQuery UI‟s DatePicker can help • $.datepicker() creates the control for you • Has numerous options, mostly default will do • $.datepicker.setDefaults() can be used to share defaults
  • 51. Dialog Box • In fact, a dialog box is nothing more that a DIV with a higher z-index and some custom chrome • jQuery will handle the nasty details for us (once again) • About every element can become the content of the dialog box • On a wrapped set, use .dialog() to make it appear as such • Triggers some events, such as close, drag and resize • Adds classes on the elements • ui-dialog • ui-dialog-title • ...
  • 53. Something missing in jQuery? •2 options: • Use an existing plugin • jQuery plugin repository: plugins.jquery.com • Google code: code.google.com • SourceForge: sourceforge.net • GitHub: github.com • Write a plugin yourself • Custom utility function • Create wrapper functions
  • 55. Writing your own plugins •Write a plugin to add it yourself! • Possible to write your own utility functions and wrapper methods •Creating new wrapper methods: • Add the method as a property on the fn object in the $ namespace
  • 57. Where to get your stuff? •Use a CDN? • Microsoft • Google •Put scripts locally as well with a fallback mechanism<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"> </script> <script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='/Scripts/jquery-1.4.2.min.js' type='text/javascript'%3E%3C/script%3E")); } </script>
  • 58. Summary •Where does all the (l) for jQuery come from? • Light-weight library that uses JavaScript as JavaScript, relying on CSS • Cross-browser compatible, hides the details (ready handler) • Easy eventing model • Can work with MVC & WebForms • Easily extensible to fit your needs, tons of plugins already available
  • 59. So I hope you now say too...
  • 62. Getting started with jQuery Gill Cleeren @gillcleeren