SlideShare a Scribd company logo
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 & jQuery
Remy Sharp
 
jQuery
jQueryjQuery
jQuery
Vishwa Mohan
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
Simon 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
jQueryjQuery
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 beginning
Anis Ahmad
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
Remy Sharp
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
Marc Grabanski
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
Isfand yar Khan
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
Kaloyan Kosev
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
Sudar Muthu
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy 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 Pro
PHP 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 Presentation
Rod 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

jQuery, CSS3 and ColdFusion
jQuery, CSS3 and ColdFusionjQuery, CSS3 and ColdFusion
jQuery, CSS3 and ColdFusion
Denard Springle IV
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
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
ghnash
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
azz71
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
Nick Lee
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Seble 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 .NET
James Johnson
 
jQuery
jQueryjQuery
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
Knoldus Inc.
 
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
Ron 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 JQuery
kolkatageeks
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
Makarand Bhatambarekar
 
Jquery tutorial-beginners
Jquery tutorial-beginnersJquery tutorial-beginners
Jquery tutorial-beginners
Isfand yar Khan
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
Mevin Mohan
 
jQuery
jQueryjQuery
Iniciando com jquery
Iniciando com jqueryIniciando com jquery
Iniciando com jquery
Danilo 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

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

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);