SlideShare a Scribd company logo
1 of 17
jQuery Training 
Write Less Do 
More... 
Presentation By :- 
Narendra Dabhi 
IndiaNIC InfoTech Ltd. 
(Sr. Yahoo Store Developer)
# Basic Structure of Jquery ? 
$(document).ready(function(){ 
// jQuery Code 
});
# Creating content. 
- Once we select a content using jQuery, we might be doing something to it. 
- Dynamic content may be added to existing page. 
- Remove certain content from the page. 
- jQuery provides mechanism to create, copy, delete and move content in page. 
- jQuery even provides the mechanism to alter the CSS properties. 
- we can create an html content as follows. 
- var data1 = $(“<p>This is content creation</p>”); 
- var dataString = “This may be a dynamic content”; 
Var data2 = $(dataString).addClass(“abc”);
# Get and Set a content. 
- Selecting a content of element is easy via jQuery 
- html() & text() functions which returns the content with respect to 
their intended function names. 
- $(“div.abc”).html(); 
- $(“p#description).text(); 
- Setting a content of elements is easy as well. 
- html(data) & text(data) sets the content of elements but there is 
a difference, html(data) will recognize the tags in the data while 
text(data) will escape the special chars and display the data as it is. 
- $(“div.abc”).html(“<p><b>This is new text</b></p>”); 
- $(“p#description).text(“<p><b>This is new text</b></p>”);
# Inserting Content. 
- jQuery provides set of functions with which we could insert content, 
before, after or within a content itself. They are of two types base on 
the arguments content & selector based. 
- append(content) 
prepend(content) 
before(content) 
after(content) 
All the function above add content to each of the elements returned by 
the jQuery selector. 
- appendTo(selector) 
prependTo(selector) 
insertBefore(selector) 
insertAfter(selector) 
All the function above add content to the specified selector.
# Wrapping, replacing & removing content. 
- wrap(html) 
- wrapAll(html) 
- wrapInner(html) 
- wrap(element) 
- wrapAll(element) 
- wrapInner(element) 
- replaceWith(content) 
- replaceAll(selector) 
- empty() 
- remove() 
- clone() 
- clone(true/false)
# Manipulate attributes. 
- jQuery provides an attr([key], [props], [key, val], [key, function(){}]) to inspect 
the attributes of the elements selected by jQuery 
- attr(name) > fetch the value of the attributed defined by the name. 
- attr(props) > here props is std JS object {src:“new.jpg”, target:“_blank”}. 
- attr(key, val) > here val will be applied to attribute defined by key. 
- jQuery also provides removeAttr(name) to remove a particular attribute.
# Working with CSS. 
_ jQuery provide the css() function, which takes following forms 
- css(name) > retrieves the value for particular css. 
- css(props) > a JS object specifying the values e.g. 
var myNewCSS = { 
'background-color' : '#FF0000', 
'color' : '#00FF00' 
}; 
- css(name, val) > set the val for the property specified by name on 
all the elements returned by the jQuery selector.
# Working with CSS. 
_ jQuery provide the functions to work on CSS Classes. 
- addClass(“abc”) > adds a class “abc” to all elements returned by query. 
- hasClass(“abc”) > returns true if any one elements has class abc. 
- removeClass(“abc”) > removes the specified class from the elements. 
- toggleClass(“abc”) > adds class if not present & remove if present. 
- toggleClass(“abc”, flag) > adds or removes the class based on flag.
# Working with CSS. 
- offset(), offsetParent() 
- position() 
- scrollTop(), scrollTop(val) 
- scrollLeft(), scrollLeft(val) 
- height(), height(val) 
- width(), width(val) 
- innerHeight(), innerWidth() 
- outerHeight(T/F), outerWidth(T/F) > True or False for considering margin
# Working with CSS. 
- offset(), offsetParent() 
- position() 
- scrollTop(), scrollTop(val) 
- scrollLeft(), scrollLeft(val) 
- height(), height(val) 
- width(), width(val) 
- innerHeight(), innerWidth() 
- outerHeight(T/F), outerWidth(T/F) > True or False for considering margin
# Create Custom Plugins 
- A jQuery plugin is simply a new method that we use to extend jQuery's prototype 
Object. By extending the prototype object you enable all jQuery objects to 
inherit any methods that you add. As established, whenever you call jQuery() you're 
creating a new jQuery object, with all of jQuery's methods inherited. 
Syntax for Create Custom Plugin :- 
(function($){ 
$.fn.<pluginname>=function(options){ 
// your code 
} 
})(jQuery);
# Create Custom Plugins 
Code in myplugin.js 
(function($){ 
$.fn.myplugin=function(options){ 
alert(“Hello this is first Plugin.”); 
} 
})(jQuery);
# Ajax. 
- AJAX stands for Asynchronous JavaScript and XML. 
- Unlike an HTTP request, Ajax allows content on Web pages to update 
immediately when a user performs an action. 
- jQuery has excellent support for AJAX 
1. $('div#id').load('/some/file.html) 
2. $.ajax({ 
url: "test.php”, 
context: document.body 
}).done(function(data) { 
$( this ).addClass( "done" ); 
}); 
3. $.ajax({ 
type: "POST", 
url: url, 
data: data, 
success: callback function, 
dataType: dataType 
});
# Ajax. 
- Other functions used for ajax are : 
post(url,params,callback) 
get(url,params,callback) 
getJSON(url,params,callback) 
getScript(url,params,callback) 
ajaxComplete() 
ajaxError() 
ajaxStart() 
ajaxStop() 
ajaxSuccess()
# Animation. 
- jQuery has built in effects: 
$('h1').hide('slow'); 
$('h1').slideDown('fast'); 
$('h1').fadeOut(2000); 
- You can chain them: 
$('h1').fadeOut(1000).slideDown(); 
- Create your own animation: 
$('#block').animate({ 
width:"+=60px", 
opacity:0.4, 
fontSize:"3em", 
borderWidth:"10px" 
},1500);
Jquery presentation

More Related Content

What's hot

Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutesSimon Willison
 
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
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Treeadamlogic
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginningAnis Ahmad
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do MoreRemy Sharp
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuerySudar Muthu
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j queryMd. Ziaul Haq
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Thinqloud
 
2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a ProPHP Conference Argentina
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery PresentationRod Johnson
 

What's hot (20)

jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 
jQuery
jQueryjQuery
jQuery
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
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 and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
jQuery
jQueryjQuery
jQuery
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
 

Similar to Jquery presentation

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
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012ghnash
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxazz71
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuerySeble Nigussie
 
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- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQueryKnoldus Inc.
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAERon Reiter
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuerykolkatageeks
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginnersIsfand yar Khan
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationMevin Mohan
 
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jqueryDanilo Sousa
 

Similar to Jquery presentation (20)

jQuery, CSS3 and ColdFusion
jQuery, CSS3 and ColdFusionjQuery, CSS3 and ColdFusion
jQuery, CSS3 and ColdFusion
 
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
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Jquery 2
Jquery 2Jquery 2
Jquery 2
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
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
jQueryjQuery
jQuery
 
J query training
J query trainingJ query training
J query training
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
 
Writing HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAEWriting HTML5 Web Apps using Backbone.js and GAE
Writing HTML5 Web Apps using Backbone.js and GAE
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginners
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
jQuery
jQueryjQuery
jQuery
 
Jquery
JqueryJquery
Jquery
 
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jquery
 

Recently uploaded

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Jquery presentation

  • 1. jQuery Training Write Less Do More... Presentation By :- Narendra Dabhi IndiaNIC InfoTech Ltd. (Sr. Yahoo Store Developer)
  • 2. # Basic Structure of Jquery ? $(document).ready(function(){ // jQuery Code });
  • 3. # Creating content. - Once we select a content using jQuery, we might be doing something to it. - Dynamic content may be added to existing page. - Remove certain content from the page. - jQuery provides mechanism to create, copy, delete and move content in page. - jQuery even provides the mechanism to alter the CSS properties. - we can create an html content as follows. - var data1 = $(“<p>This is content creation</p>”); - var dataString = “This may be a dynamic content”; Var data2 = $(dataString).addClass(“abc”);
  • 4. # Get and Set a content. - Selecting a content of element is easy via jQuery - html() & text() functions which returns the content with respect to their intended function names. - $(“div.abc”).html(); - $(“p#description).text(); - Setting a content of elements is easy as well. - html(data) & text(data) sets the content of elements but there is a difference, html(data) will recognize the tags in the data while text(data) will escape the special chars and display the data as it is. - $(“div.abc”).html(“<p><b>This is new text</b></p>”); - $(“p#description).text(“<p><b>This is new text</b></p>”);
  • 5. # Inserting Content. - jQuery provides set of functions with which we could insert content, before, after or within a content itself. They are of two types base on the arguments content & selector based. - append(content) prepend(content) before(content) after(content) All the function above add content to each of the elements returned by the jQuery selector. - appendTo(selector) prependTo(selector) insertBefore(selector) insertAfter(selector) All the function above add content to the specified selector.
  • 6. # Wrapping, replacing & removing content. - wrap(html) - wrapAll(html) - wrapInner(html) - wrap(element) - wrapAll(element) - wrapInner(element) - replaceWith(content) - replaceAll(selector) - empty() - remove() - clone() - clone(true/false)
  • 7. # Manipulate attributes. - jQuery provides an attr([key], [props], [key, val], [key, function(){}]) to inspect the attributes of the elements selected by jQuery - attr(name) > fetch the value of the attributed defined by the name. - attr(props) > here props is std JS object {src:“new.jpg”, target:“_blank”}. - attr(key, val) > here val will be applied to attribute defined by key. - jQuery also provides removeAttr(name) to remove a particular attribute.
  • 8. # Working with CSS. _ jQuery provide the css() function, which takes following forms - css(name) > retrieves the value for particular css. - css(props) > a JS object specifying the values e.g. var myNewCSS = { 'background-color' : '#FF0000', 'color' : '#00FF00' }; - css(name, val) > set the val for the property specified by name on all the elements returned by the jQuery selector.
  • 9. # Working with CSS. _ jQuery provide the functions to work on CSS Classes. - addClass(“abc”) > adds a class “abc” to all elements returned by query. - hasClass(“abc”) > returns true if any one elements has class abc. - removeClass(“abc”) > removes the specified class from the elements. - toggleClass(“abc”) > adds class if not present & remove if present. - toggleClass(“abc”, flag) > adds or removes the class based on flag.
  • 10. # Working with CSS. - offset(), offsetParent() - position() - scrollTop(), scrollTop(val) - scrollLeft(), scrollLeft(val) - height(), height(val) - width(), width(val) - innerHeight(), innerWidth() - outerHeight(T/F), outerWidth(T/F) > True or False for considering margin
  • 11. # Working with CSS. - offset(), offsetParent() - position() - scrollTop(), scrollTop(val) - scrollLeft(), scrollLeft(val) - height(), height(val) - width(), width(val) - innerHeight(), innerWidth() - outerHeight(T/F), outerWidth(T/F) > True or False for considering margin
  • 12. # Create Custom Plugins - A jQuery plugin is simply a new method that we use to extend jQuery's prototype Object. By extending the prototype object you enable all jQuery objects to inherit any methods that you add. As established, whenever you call jQuery() you're creating a new jQuery object, with all of jQuery's methods inherited. Syntax for Create Custom Plugin :- (function($){ $.fn.<pluginname>=function(options){ // your code } })(jQuery);
  • 13. # Create Custom Plugins Code in myplugin.js (function($){ $.fn.myplugin=function(options){ alert(“Hello this is first Plugin.”); } })(jQuery);
  • 14. # Ajax. - AJAX stands for Asynchronous JavaScript and XML. - Unlike an HTTP request, Ajax allows content on Web pages to update immediately when a user performs an action. - jQuery has excellent support for AJAX 1. $('div#id').load('/some/file.html) 2. $.ajax({ url: "test.php”, context: document.body }).done(function(data) { $( this ).addClass( "done" ); }); 3. $.ajax({ type: "POST", url: url, data: data, success: callback function, dataType: dataType });
  • 15. # Ajax. - Other functions used for ajax are : post(url,params,callback) get(url,params,callback) getJSON(url,params,callback) getScript(url,params,callback) ajaxComplete() ajaxError() ajaxStart() ajaxStop() ajaxSuccess()
  • 16. # Animation. - jQuery has built in effects: $('h1').hide('slow'); $('h1').slideDown('fast'); $('h1').fadeOut(2000); - You can chain them: $('h1').fadeOut(1000).slideDown(); - Create your own animation: $('#block').animate({ width:"+=60px", opacity:0.4, fontSize:"3em", borderWidth:"10px" },1500);