SlideShare une entreprise Scribd logo
1  sur  23
JQUERY
Prepared By

Jay Poojara

1
WHAT IS JQUERY?
jQuery is a fast, small, and feature-rich JavaScript library. It
makes things like HTML document traversal and manipulation, event
handling, animation, and Ajax much simpler with an easy-to-use API
that works across a multitude of browsers. With a combination of
versatility and extensibility, jQuery has changed the way that millions of
people write JavaScript.

2
WHY IS JQUERY AWESOME?
What jQuery does well:
1.
2.
3.
4.
5.

Simplified AJAX
DOM Manipulation
Event Management
Animations
Normalizes Browser Differences

Why It Is Successful:
1.
2.
3.
4.
5.

Well Designed
Easy to extend with plugins
Great Documentation
Large jQuery Community
Cross-browser

3
JQUERY FOUNDER

4
WHO'S USING JQUERY?

….This are some of the examples….

5
JQUERY PHILOSOPHY
Find some stuff

Do something to it

6
SAMPLE JQUERY
Our DOM
Include jQuery
The „ready event‟ – Binds a function to
be executed whenever the DOM is
ready
Select the „toggleContent‟ DOM
element and bind a click event
handler to it.
Select the „content‟ DOM element and
set the text to „Hello World!‟
Prevent the default behavior of the
anchor tag by returning false
7
DOLLAR FUNCTION $();
• JavaScript identifiers can start with $
• The jQuery framework automatically assigns „$‟ to the „jQuery‟
function
$ === jQuery true
$(selector) is same as jQuery(selector)

• Can use utility function to unassign $
$.noConflict();
$ === jQuery;

false

• Can reassign jQuery to another variable
$j = $.noConflict();

$j === jQuery;

true

$j === $;

false
8

$ === jQuery;

false
DOCUMENT READY EVENT
• $(document).ready(fn);
• The bound function will be called the instant the
DOM is ready to be read and manipulated.
• As many as you want on the page.
• Executed in the order they were added.

• There is a shortcut: $(fn);

9
SELECTORS
CSS3 Selectors
jQuery

Selects…

$(„#myId‟)

By ID

$(„div‟)

By Element Type

$(„.myClass‟)

By Class

$(„div, span, p.myClass, #myid‟)

Multiple

$(„*‟)

All

$(„.myClass‟, this), $(„p.myClass‟)

By Context (better performance)

$(„#main div‟)

Descendents (all levels)

$(„#main > div‟)

Children (first level)

$(„label + input‟)

The immediate element after

$(„#prev ~ div‟)

The first element after

$(„div[id]‟)

All elements that have the specified attribute

$(„input[type=text]‟)

By Attribute value
10
FILTERS
$(„div:empty‟), $(„:empty‟), $(„div:not(:empty)‟)
jQuery

Filters…

:first, :last, :nth(n)

First, Last, Nth Element

:odd, :even

Odd, Even Elements

:visible, :hidden

Visible, Hidden Elements

:enabled, :disabled

Enabled, Disabled Elements

:contains(“text”)

Contains specified text

:empty

Elements w/ no children (or text)

:first-child, :last-child, :nthchild(n)

Child Element

:lt(n), :gt(n)

Elements w/ index below or after

:not(selector)

Does not match selector

:MyCustomFilter

Custom Filters (Implement your own!)

Custom Filter Used

11
CHAINING
• Most jQuery methods return another jQuery object (usually the same
collection), which means you can chain method calls together with a
fluent like syntax
• Some methods that stop a chain, these methods return a value from the
jQuery object
.css(name), .text(), .html(), .val(), .height(), .width(), .is(„:visible‟)

• Some methods will return a different jQuery collection, you can revert
to the previous collection by calling .end();

12
ATTRIBUTES & CLASSES
• Getters & Setters for attr, html, text, val
• Getter (returns String – breaks chain)
var text = $(„#myDiv‟).text();

• Setter (returns jQuery)
$(„#myDiv‟).text(„Hello World!‟);

• text() escapes html()
• val() used with inputs

• attr() can take JSON

• Add, Remove for Attributes & Classes
• .removeAttr(„someAttr‟);
• .addClass(„someClass‟);

• .removeClass(„someClass‟);
• .toggleClass(„someClass‟);
13
TRAVERSING
• Family
• parent, parents, siblings, children

• Proximity
• closest, next, prev, nextAll, prevAll

• Searching
• find

14
EVENTS
.bind(type, data, fn)
• Binds a handler to an event on all matched elements

.one(type, data, fn)
• Binds a handler to be executed only once for each matched element

.trigger(event, data)
• Trigger an event to occur on all matched elements

.unbind(type, fn)
• Removes event handlers from all matched elements

.live(type, fn)
• Binds a handler to an event on all currently matched and future matched elements.

.die(type, fn)
• Removes a bound live event.

.hover(fnOver, fnOut)
• Interaction helper that will handle mouseover and mouseout

.toggle(fn1, fn2, fn3, fnN, …)
• Interaction helper that will toggle among two or more function calls every other click.

15
EVENT HELPERS
blur, change, click, dblclick, error, focus, keydown, keypress, k
eyup, load, mousedown, mouseenter, mouseleave, mousemov
e, mouseup, resize, scroll, select, submit, unload

16
MANIPULATION
• Inserting Inside
•

append, prepend

•

appendTo, prependTo

• Inserting Outside
•

after, before

•

insertAfter, insertBefore

• Inserting Around
•

wrapInner

•

wrap

•

wrapAll

• Replacing
•

replaceWith, replaceAll

• Removing
•

empty, remove

• Copying
•

clone
17
EFFECTS
• Basics
• show, hide, toggle

• Sliding
• slideUp, slideDown, slideToggle

• Fading
• fadeIn, fadeOut, fadeTo (opacity 0-1)

• Custom
• animate, stop

18
PLUG-INS
• Extremely Simple – Promotes code reuse and DRY principle
$.fn.MyPlugin = function(params) {};

• Return a jQuery object to prevent from “breaking the chain”
• Unless you are returning a specific value

• Best Practice is to wrap the plug-in declaration within an anonymous
JavaScript function in order to prevent collisions with the use of $

19
UTILITY FUNCTIONS
• Array and Object Operations
$.each(object, callback) – Callback function will run for each item in the object. The each method
is meant to be an immutable iterator and returns the original array.
$.map(array, callback) – Callback function will run for each item in the array. The map method
can be used as an iterator, but is designed to be used for manipulation of the supplied array
and returns a new array.
$.merge(first, second) – Merges the second array into the first array.
$.unique(array) – Removes duplicate elements (only works on arrays of DOM elements).
$.extend(object) – Add functions into the jQuery namespace.
$.extend(deep, target, object1, objectN) – Merge values from objects 1 to N into target object.
Deep is an optional boolean that if true, tells jQuery to do a deep copy.
$.grep(array, callback, invert) – Iterates through array, and returns a new array with values from
the original array that satisfy the criteria specified in the callback.
$.inArray(value, array) – Gets the index of the value in the array (-1 if not found).

• String Operations
$.trim(str) – Removes whitespace from the given string.

• Test Operations
$.isArray(obj) – Determines if the object is an array.
$.isFunction(obj) – Determines if the object is a function.

20
JQUERY DATA
• Can store data on one or more jQuery elements
• .data(name, value)

• value is an object

• Retrieves data from the first element in the jQuery object
• .data(name)

21
RESOURCES
• jQuery Main
•

http://jquery.com

•

http://docs.jquery.com/Downloading_jQuery

• jQuery API Documentation
•

http://api.jquery.com

•

http://docs.jquery.com

• jQuery UI
•

http://jqueryui.com

•

http://jqueryui.com/themeroller/

• jQuery Blog
•

http://blog.jquery.com/

• Around The Web
•

•

http://www.nettuts.com

•

•

http://stackoverflow.com

http://www.smashingmagazine.com

Tools
•

Visual Studio JavaScript Intellisense Support (KB958502)

•

http://getfirebug.com/ (Firebug Firefox Plug-in)

•

http://jsbin.com/ (JS Bin - Collaborative JavaScript Debugging)

22
THANK YOU
Even a correct decision is wrong when it was taken too
late.

any Queries?

23

Contenu connexe

Tendances

jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...Edureka!
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom ManipulationMohammed Arif
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesHùng Nguyễn Huy
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript TutorialBui Kiet
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/jsKnoldus Inc.
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryFAKHRUN NISHA
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)GOPAL BASAK
 

Tendances (20)

JavaScript
JavaScriptJavaScript
JavaScript
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
jQuery
jQueryjQuery
jQuery
 
HTML/CSS/java Script/Jquery
HTML/CSS/java Script/JqueryHTML/CSS/java Script/Jquery
HTML/CSS/java Script/Jquery
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)
 

En vedette

jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery PresentationRod Johnson
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutesSimon Willison
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQueryKnoldus Inc.
 
Présentation jQuery pour débutant
Présentation jQuery pour débutantPrésentation jQuery pour débutant
Présentation jQuery pour débutantStanislas Chollet
 
Jquery - introduction au langage
Jquery - introduction au langageJquery - introduction au langage
Jquery - introduction au langageStrasWeb
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesSimon Willison
 
Communication skill ii
Communication skill iiCommunication skill ii
Communication skill iiRudra Bhatt
 
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
 
Introduction To Javascript
Introduction To JavascriptIntroduction To Javascript
Introduction To JavascriptRajat Pandit
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by MukeshMukesh Kumar
 
Project Seminar on Leapmotion Technology
Project Seminar on Leapmotion TechnologyProject Seminar on Leapmotion Technology
Project Seminar on Leapmotion TechnologyAbhijit Dey
 

En vedette (20)

jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
Leap motion
Leap motionLeap motion
Leap motion
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
 
Présentation jQuery pour débutant
Présentation jQuery pour débutantPrésentation jQuery pour débutant
Présentation jQuery pour débutant
 
Jquery - introduction au langage
Jquery - introduction au langageJquery - introduction au langage
Jquery - introduction au langage
 
JQuery
JQueryJQuery
JQuery
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
Communication skill ii
Communication skill iiCommunication skill ii
Communication skill ii
 
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)
 
Introduction To Javascript
Introduction To JavascriptIntroduction To Javascript
Introduction To Javascript
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Hololens
Hololens Hololens
Hololens
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
Leap motion
Leap motionLeap motion
Leap motion
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Project Seminar on Leapmotion Technology
Project Seminar on Leapmotion TechnologyProject Seminar on Leapmotion Technology
Project Seminar on Leapmotion Technology
 
Leap motion
Leap motionLeap motion
Leap motion
 

Similaire à jQuery

J query introduction
J query introductionJ query introduction
J query introductionSMS_VietNam
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryZeeshan Khan
 
Javascript And J Query
Javascript And J QueryJavascript And J Query
Javascript And J Queryitsarsalan
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlinShem Magnezi
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New EvolutionAllan Huang
 
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 .NETJames Johnson
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue AdventureAllegient
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin developmentFaruk Hossen
 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Chris Adamson
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And TricksLester Lievens
 

Similaire à jQuery (20)

jQuery
jQueryjQuery
jQuery
 
Jquery
JqueryJquery
Jquery
 
J query introduction
J query introductionJ query introduction
J query introduction
 
Jquery for Beginners
Jquery for BeginnersJquery for Beginners
Jquery for Beginners
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Javascript And J Query
Javascript And J QueryJavascript And J Query
Javascript And J Query
 
Scala coated JVM
Scala coated JVMScala coated JVM
Scala coated JVM
 
Building android apps with kotlin
Building android apps with kotlinBuilding android apps with kotlin
Building android apps with kotlin
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
 
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
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
JQuery
JQueryJQuery
JQuery
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hw09 Hadoop + Clojure
Hw09   Hadoop + ClojureHw09   Hadoop + Clojure
Hw09 Hadoop + Clojure
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin development
 
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
Revenge of the 80s: Cut/Copy/Paste, Undo/Redo, and More Big Hits (CocoaConf C...
 
Jquery 3
Jquery 3Jquery 3
Jquery 3
 
jQuery
jQueryjQuery
jQuery
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
jQuery - Tips And Tricks
jQuery - Tips And TricksjQuery - Tips And Tricks
jQuery - Tips And Tricks
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

jQuery

  • 2. WHAT IS JQUERY? jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript. 2
  • 3. WHY IS JQUERY AWESOME? What jQuery does well: 1. 2. 3. 4. 5. Simplified AJAX DOM Manipulation Event Management Animations Normalizes Browser Differences Why It Is Successful: 1. 2. 3. 4. 5. Well Designed Easy to extend with plugins Great Documentation Large jQuery Community Cross-browser 3
  • 5. WHO'S USING JQUERY? ….This are some of the examples…. 5
  • 6. JQUERY PHILOSOPHY Find some stuff Do something to it 6
  • 7. SAMPLE JQUERY Our DOM Include jQuery The „ready event‟ – Binds a function to be executed whenever the DOM is ready Select the „toggleContent‟ DOM element and bind a click event handler to it. Select the „content‟ DOM element and set the text to „Hello World!‟ Prevent the default behavior of the anchor tag by returning false 7
  • 8. DOLLAR FUNCTION $(); • JavaScript identifiers can start with $ • The jQuery framework automatically assigns „$‟ to the „jQuery‟ function $ === jQuery true $(selector) is same as jQuery(selector) • Can use utility function to unassign $ $.noConflict(); $ === jQuery; false • Can reassign jQuery to another variable $j = $.noConflict(); $j === jQuery; true $j === $; false 8 $ === jQuery; false
  • 9. DOCUMENT READY EVENT • $(document).ready(fn); • The bound function will be called the instant the DOM is ready to be read and manipulated. • As many as you want on the page. • Executed in the order they were added. • There is a shortcut: $(fn); 9
  • 10. SELECTORS CSS3 Selectors jQuery Selects… $(„#myId‟) By ID $(„div‟) By Element Type $(„.myClass‟) By Class $(„div, span, p.myClass, #myid‟) Multiple $(„*‟) All $(„.myClass‟, this), $(„p.myClass‟) By Context (better performance) $(„#main div‟) Descendents (all levels) $(„#main > div‟) Children (first level) $(„label + input‟) The immediate element after $(„#prev ~ div‟) The first element after $(„div[id]‟) All elements that have the specified attribute $(„input[type=text]‟) By Attribute value 10
  • 11. FILTERS $(„div:empty‟), $(„:empty‟), $(„div:not(:empty)‟) jQuery Filters… :first, :last, :nth(n) First, Last, Nth Element :odd, :even Odd, Even Elements :visible, :hidden Visible, Hidden Elements :enabled, :disabled Enabled, Disabled Elements :contains(“text”) Contains specified text :empty Elements w/ no children (or text) :first-child, :last-child, :nthchild(n) Child Element :lt(n), :gt(n) Elements w/ index below or after :not(selector) Does not match selector :MyCustomFilter Custom Filters (Implement your own!) Custom Filter Used 11
  • 12. CHAINING • Most jQuery methods return another jQuery object (usually the same collection), which means you can chain method calls together with a fluent like syntax • Some methods that stop a chain, these methods return a value from the jQuery object .css(name), .text(), .html(), .val(), .height(), .width(), .is(„:visible‟) • Some methods will return a different jQuery collection, you can revert to the previous collection by calling .end(); 12
  • 13. ATTRIBUTES & CLASSES • Getters & Setters for attr, html, text, val • Getter (returns String – breaks chain) var text = $(„#myDiv‟).text(); • Setter (returns jQuery) $(„#myDiv‟).text(„Hello World!‟); • text() escapes html() • val() used with inputs • attr() can take JSON • Add, Remove for Attributes & Classes • .removeAttr(„someAttr‟); • .addClass(„someClass‟); • .removeClass(„someClass‟); • .toggleClass(„someClass‟); 13
  • 14. TRAVERSING • Family • parent, parents, siblings, children • Proximity • closest, next, prev, nextAll, prevAll • Searching • find 14
  • 15. EVENTS .bind(type, data, fn) • Binds a handler to an event on all matched elements .one(type, data, fn) • Binds a handler to be executed only once for each matched element .trigger(event, data) • Trigger an event to occur on all matched elements .unbind(type, fn) • Removes event handlers from all matched elements .live(type, fn) • Binds a handler to an event on all currently matched and future matched elements. .die(type, fn) • Removes a bound live event. .hover(fnOver, fnOut) • Interaction helper that will handle mouseover and mouseout .toggle(fn1, fn2, fn3, fnN, …) • Interaction helper that will toggle among two or more function calls every other click. 15
  • 16. EVENT HELPERS blur, change, click, dblclick, error, focus, keydown, keypress, k eyup, load, mousedown, mouseenter, mouseleave, mousemov e, mouseup, resize, scroll, select, submit, unload 16
  • 17. MANIPULATION • Inserting Inside • append, prepend • appendTo, prependTo • Inserting Outside • after, before • insertAfter, insertBefore • Inserting Around • wrapInner • wrap • wrapAll • Replacing • replaceWith, replaceAll • Removing • empty, remove • Copying • clone 17
  • 18. EFFECTS • Basics • show, hide, toggle • Sliding • slideUp, slideDown, slideToggle • Fading • fadeIn, fadeOut, fadeTo (opacity 0-1) • Custom • animate, stop 18
  • 19. PLUG-INS • Extremely Simple – Promotes code reuse and DRY principle $.fn.MyPlugin = function(params) {}; • Return a jQuery object to prevent from “breaking the chain” • Unless you are returning a specific value • Best Practice is to wrap the plug-in declaration within an anonymous JavaScript function in order to prevent collisions with the use of $ 19
  • 20. UTILITY FUNCTIONS • Array and Object Operations $.each(object, callback) – Callback function will run for each item in the object. The each method is meant to be an immutable iterator and returns the original array. $.map(array, callback) – Callback function will run for each item in the array. The map method can be used as an iterator, but is designed to be used for manipulation of the supplied array and returns a new array. $.merge(first, second) – Merges the second array into the first array. $.unique(array) – Removes duplicate elements (only works on arrays of DOM elements). $.extend(object) – Add functions into the jQuery namespace. $.extend(deep, target, object1, objectN) – Merge values from objects 1 to N into target object. Deep is an optional boolean that if true, tells jQuery to do a deep copy. $.grep(array, callback, invert) – Iterates through array, and returns a new array with values from the original array that satisfy the criteria specified in the callback. $.inArray(value, array) – Gets the index of the value in the array (-1 if not found). • String Operations $.trim(str) – Removes whitespace from the given string. • Test Operations $.isArray(obj) – Determines if the object is an array. $.isFunction(obj) – Determines if the object is a function. 20
  • 21. JQUERY DATA • Can store data on one or more jQuery elements • .data(name, value) • value is an object • Retrieves data from the first element in the jQuery object • .data(name) 21
  • 22. RESOURCES • jQuery Main • http://jquery.com • http://docs.jquery.com/Downloading_jQuery • jQuery API Documentation • http://api.jquery.com • http://docs.jquery.com • jQuery UI • http://jqueryui.com • http://jqueryui.com/themeroller/ • jQuery Blog • http://blog.jquery.com/ • Around The Web • • http://www.nettuts.com • • http://stackoverflow.com http://www.smashingmagazine.com Tools • Visual Studio JavaScript Intellisense Support (KB958502) • http://getfirebug.com/ (Firebug Firefox Plug-in) • http://jsbin.com/ (JS Bin - Collaborative JavaScript Debugging) 22
  • 23. THANK YOU Even a correct decision is wrong when it was taken too late. any Queries? 23

Notes de l'éditeur

  1. Unobtrusive JavaScriptLess code
  2. Unobtrusive JavaScriptLess code
  3. Demo
  4. Demo
  5. Demo
  6. Demo
  7. Demo
  8. Demo
  9. Demo