SlideShare una empresa de Scribd logo
1 de 34
jQuery(Framework and UI) By Achinth Anand Gurkhi
What is jQuery? Is a JavaScript framework It was first released in Jan 2006 Latest version is 1.4.4 Makes JavaScript development easier Developers need not worry about cross browser compatibility Reduces lines of code Supports IE6+, Firefox1.5+, Safari2.0.2+, Opera9+ & Chrome0.2+ Also contains a separate UI library to simplify UI tasks Is superfast and small – just 24 KB Used by over 31% of the 10,000 most visited websites Supported by Microsoft as well
jQuery Features DOM element selections using the cross-browser open source selector engine Sizzle, a spin-off out of the jQuery project DOM traversal and modification Events  CSS manipulation  Effects and animations  Ajax  Extensibility through plug-ins
jQuery Components jQuery Framework jQuery UI jQuery Plug-ins
jQuery Framework
How to use jQuery? Option 1: Download jquery-<version>.min.js from www.jquery.com and use it using <script type=‘text/javascript’ src=‘jquery.min.js’/>  Option 2: From Google using <script type=‘text/javascript’ src=‘http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js’/> Option 3: From Microsoft using <script type=‘text/javascript’ src=‘http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js’/> Note: Option 2 and 3 are recommended in production for performance reasons.
The $ shortcut $ is the shortcut to access the jQuery library jQuery(‘p’).addClass()  $(‘p’).addClass()
DOM ready event $(document).ready() $(document).ready(function() {             // do something     });  Note: Document ready event is different from body on load event.
Selectors $('div') - Accesses all the div elements in the HTML file. $('#A') - Accesses all the HTML elements with id=A. $('.b') - Accesses all the HTML elements with class=b. $(‘p.b’) - Accesses all the paragraph element with class=b. $(‘.a.b’) - Accesses all the HTML elements with class=a and b. and there are many more like (a+b), (a > b), (a/b), (a, b), etc. http://api.jquery.com/category/selectors/
Filters filter() not() lt() gt() eq() contains() has()
DOM traversal methods find() children() parents() parent() siblings() prev() next()
DOM manipulation methods text() html() attr() val() prepend() and prependTo() append() and appendTo() before() and insertBefore() after() and insertAfter() wrap() clone() empty() remove()
CSS Manipulation addClass() removeClass() toggleClass() css()
Demo 1 $ DOM ready event Accessing a node text() html() addClass() children() parent() each() prepend() and prependTo() clone() this
Arrays Array is defined as below: vararr = [“abc”, “bcd”, “cde”, “efg”]; Some common functions used on arrays: join each get sort grep (filtering) match (regular expressions) splice (array splitting) concat (join two arrays)
Object Array	 varstudents=[   	{  "role": 101,  "name": "Ben",  "emailId":"ben@gmail.com"  },       {  "role": 102,  "name": "Ian",  "emailId":"ian@gmail.com"  },       {  "role": 103,  "name": "Caroline",  "emailId":"carol@gmail.com"  }       ]
Demo 2 Array - join and each functions
Events Two ways to bind controls to event $(’#x').bind('click', function(){     // event handling }); $(’#x').click(function(){         // event handling });
Events – continued Use $(event.target) or ‘this’ to determine which control caused the event.  Events can be triggered using the trigger(event) function. Use unbind() to de-register a control event handler. Use one() instead of bind() if you want the event handler to trigger only once.
Mouse events click() dblClick() mouseUp() mouseDown() mouseOver() mouseOut() Mouse button clicked can be determined using event.button 1 = left button 2 = right button Mouse co-ordinate can be determined using event.screenX and event.screenY
Keyboard and Document events Keyboard keyPress() keyUp() keyDown() Which key is pressed can be determined using event.keyCode Document ready() load() unload() error()
Form and Browser Events Form Elements focus() blur() submit() change() select() Browser resize() scroll()
Demo 3 Binding events Triggering events
Animations show()  hide() toggle() fadeIn() fadeOut() slideUp() slideDown() slideToggle() fadeTo()  animate()
Demo 4 show() hide() fadeIn() fadeOut() slideDown() slideUp()
AJAX $.ajax( 		url: ‘xyz.com/xxx’, 		type: get/post, 		data: …. 		timeout: (in milliseconds), 		success: function(), 		error: function(), 		dataType: xml/html/json/script, 		async: true/false 	)
AJAX Shortcut methods get() post() load() getJSON() getScript()
Demo 5 load() ajax()
jQuery UI jQuery UI (www.jqueryui.com)
jQuery UI jQuery UI provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications
Interactions Dragging Dropping Re-sizing Selecting Sorting
Widgets Accordion AutoComplete Button DatePicker Dialog ProgressBar Slider Tabs
Effects Color Animation ToggleClass AddClass RemoveClass SwitchClass Effect Toggle Hide Show
Demo 6 http://jqueryui.com/demos/

Más contenido relacionado

La actualidad más candente

Database madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemyDatabase madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemyJaime Buelta
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 42 of 180
The Ring programming language version 1.5.1 book - Part 42 of 180The Ring programming language version 1.5.1 book - Part 42 of 180
The Ring programming language version 1.5.1 book - Part 42 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202Mahmoud Samir Fayed
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersJaime Buelta
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryZeeshan Khan
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Libraryrsnarayanan
 

La actualidad más candente (20)

Database madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemyDatabase madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemy
 
jQuery Selectors
jQuery SelectorsjQuery Selectors
jQuery Selectors
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
The jQuery Library
The  jQuery LibraryThe  jQuery Library
The jQuery Library
 
jQuery
jQueryjQuery
jQuery
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
 
The Ring programming language version 1.5.1 book - Part 42 of 180
The Ring programming language version 1.5.1 book - Part 42 of 180The Ring programming language version 1.5.1 book - Part 42 of 180
The Ring programming language version 1.5.1 book - Part 42 of 180
 
The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.8 book - Part 49 of 202
 
jQuery
jQueryjQuery
jQuery
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
NoSQL - Hands on
NoSQL - Hands onNoSQL - Hands on
NoSQL - Hands on
 
Sequel
SequelSequel
Sequel
 
J Query The Write Less Do More Javascript Library
J Query   The Write Less Do More Javascript LibraryJ Query   The Write Less Do More Javascript Library
J Query The Write Less Do More Javascript Library
 
Jquery
JqueryJquery
Jquery
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
 
J query training
J query trainingJ query training
J query training
 

Destacado

Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Ashish Jha
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerJAXLondon_Conference
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?C2B2 Consulting
 
G1 collector and tuning and Cassandra
G1 collector and tuning and CassandraG1 collector and tuning and Cassandra
G1 collector and tuning and CassandraChris Lohfink
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerMonica Beckwith
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionSomya Bagai
 
Garbage collection algorithms
Garbage collection algorithmsGarbage collection algorithms
Garbage collection algorithmsachinth
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage CollectionAzul Systems Inc.
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage CollectionHaim Yadid
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage CollectionDoug Hawkins
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection TechniquesAn Khuong
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9Simon Ritter
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningSimone Bordet
 

Destacado (18)

Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)Mark and sweep algorithm(garbage collector)
Mark and sweep algorithm(garbage collector)
 
Garbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika LangerGarbage Collection Pause Times - Angelika Langer
Garbage Collection Pause Times - Angelika Langer
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
 
G1 collector and tuning and Cassandra
G1 collector and tuning and CassandraG1 collector and tuning and Cassandra
G1 collector and tuning and Cassandra
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Garbage collection algorithms
Garbage collection algorithmsGarbage collection algorithms
Garbage collection algorithms
 
How long can you afford to Stop The World?
How long can you afford to Stop The World?How long can you afford to Stop The World?
How long can you afford to Stop The World?
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
Java GC
Java GCJava GC
Java GC
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection Techniques
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and Tuning
 

Similar a Introduction to jQuery

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 BasicsEPAM Systems
 
jQuery presentation
jQuery presentationjQuery presentation
jQuery presentationMahesh Reddy
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
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 DeveloperManoj Bhuva
 
J query presentation
J query presentationJ query presentation
J query presentationakanksha17
 
J query presentation
J query presentationJ query presentation
J query presentationsawarkar17
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaztestingphase
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using AxeRapidValue
 
Top 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaTop 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaEdureka!
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet IntroductionWei Sun
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks TriviaCognizant
 
JS Libraries and jQuery Overview
JS Libraries and jQuery OverviewJS Libraries and jQuery Overview
JS Libraries and jQuery OverviewAleksandr Motsjonov
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slideshelenmga
 

Similar a Introduction to 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
 
jQuery presentation
jQuery presentationjQuery presentation
jQuery presentation
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
JQuery
JQueryJQuery
JQuery
 
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
 
J query presentation
J query presentationJ query presentation
J query presentation
 
J query presentation
J query presentationJ query presentation
J query presentation
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using Axe
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Top 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | EdurekaTop 45 jQuery Interview Questions and Answers | Edureka
Top 45 jQuery Interview Questions and Answers | Edureka
 
JQuery
JQueryJQuery
JQuery
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
 
JS Libraries and jQuery Overview
JS Libraries and jQuery OverviewJS Libraries and jQuery Overview
JS Libraries and jQuery Overview
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Jquery dojo slides
Jquery dojo slidesJquery dojo slides
Jquery dojo slides
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
J query module1
J query module1J query module1
J query module1
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 

Introduction to jQuery

  • 1. jQuery(Framework and UI) By Achinth Anand Gurkhi
  • 2. What is jQuery? Is a JavaScript framework It was first released in Jan 2006 Latest version is 1.4.4 Makes JavaScript development easier Developers need not worry about cross browser compatibility Reduces lines of code Supports IE6+, Firefox1.5+, Safari2.0.2+, Opera9+ & Chrome0.2+ Also contains a separate UI library to simplify UI tasks Is superfast and small – just 24 KB Used by over 31% of the 10,000 most visited websites Supported by Microsoft as well
  • 3. jQuery Features DOM element selections using the cross-browser open source selector engine Sizzle, a spin-off out of the jQuery project DOM traversal and modification Events CSS manipulation Effects and animations Ajax Extensibility through plug-ins
  • 4. jQuery Components jQuery Framework jQuery UI jQuery Plug-ins
  • 6. How to use jQuery? Option 1: Download jquery-<version>.min.js from www.jquery.com and use it using <script type=‘text/javascript’ src=‘jquery.min.js’/> Option 2: From Google using <script type=‘text/javascript’ src=‘http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js’/> Option 3: From Microsoft using <script type=‘text/javascript’ src=‘http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js’/> Note: Option 2 and 3 are recommended in production for performance reasons.
  • 7. The $ shortcut $ is the shortcut to access the jQuery library jQuery(‘p’).addClass() $(‘p’).addClass()
  • 8. DOM ready event $(document).ready() $(document).ready(function() { // do something }); Note: Document ready event is different from body on load event.
  • 9. Selectors $('div') - Accesses all the div elements in the HTML file. $('#A') - Accesses all the HTML elements with id=A. $('.b') - Accesses all the HTML elements with class=b. $(‘p.b’) - Accesses all the paragraph element with class=b. $(‘.a.b’) - Accesses all the HTML elements with class=a and b. and there are many more like (a+b), (a > b), (a/b), (a, b), etc. http://api.jquery.com/category/selectors/
  • 10. Filters filter() not() lt() gt() eq() contains() has()
  • 11. DOM traversal methods find() children() parents() parent() siblings() prev() next()
  • 12. DOM manipulation methods text() html() attr() val() prepend() and prependTo() append() and appendTo() before() and insertBefore() after() and insertAfter() wrap() clone() empty() remove()
  • 13. CSS Manipulation addClass() removeClass() toggleClass() css()
  • 14. Demo 1 $ DOM ready event Accessing a node text() html() addClass() children() parent() each() prepend() and prependTo() clone() this
  • 15. Arrays Array is defined as below: vararr = [“abc”, “bcd”, “cde”, “efg”]; Some common functions used on arrays: join each get sort grep (filtering) match (regular expressions) splice (array splitting) concat (join two arrays)
  • 16. Object Array varstudents=[ { "role": 101, "name": "Ben", "emailId":"ben@gmail.com" }, { "role": 102, "name": "Ian", "emailId":"ian@gmail.com" }, { "role": 103, "name": "Caroline", "emailId":"carol@gmail.com" } ]
  • 17. Demo 2 Array - join and each functions
  • 18. Events Two ways to bind controls to event $(’#x').bind('click', function(){ // event handling }); $(’#x').click(function(){ // event handling });
  • 19. Events – continued Use $(event.target) or ‘this’ to determine which control caused the event. Events can be triggered using the trigger(event) function. Use unbind() to de-register a control event handler. Use one() instead of bind() if you want the event handler to trigger only once.
  • 20. Mouse events click() dblClick() mouseUp() mouseDown() mouseOver() mouseOut() Mouse button clicked can be determined using event.button 1 = left button 2 = right button Mouse co-ordinate can be determined using event.screenX and event.screenY
  • 21. Keyboard and Document events Keyboard keyPress() keyUp() keyDown() Which key is pressed can be determined using event.keyCode Document ready() load() unload() error()
  • 22. Form and Browser Events Form Elements focus() blur() submit() change() select() Browser resize() scroll()
  • 23. Demo 3 Binding events Triggering events
  • 24. Animations show() hide() toggle() fadeIn() fadeOut() slideUp() slideDown() slideToggle() fadeTo() animate()
  • 25. Demo 4 show() hide() fadeIn() fadeOut() slideDown() slideUp()
  • 26. AJAX $.ajax( url: ‘xyz.com/xxx’, type: get/post, data: …. timeout: (in milliseconds), success: function(), error: function(), dataType: xml/html/json/script, async: true/false )
  • 27. AJAX Shortcut methods get() post() load() getJSON() getScript()
  • 28. Demo 5 load() ajax()
  • 29. jQuery UI jQuery UI (www.jqueryui.com)
  • 30. jQuery UI jQuery UI provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications
  • 31. Interactions Dragging Dropping Re-sizing Selecting Sorting
  • 32. Widgets Accordion AutoComplete Button DatePicker Dialog ProgressBar Slider Tabs
  • 33. Effects Color Animation ToggleClass AddClass RemoveClass SwitchClass Effect Toggle Hide Show