SlideShare una empresa de Scribd logo
1 de 35
by: Jeremiah G. Gatong
Things to know first…
The JavaScript Ninja! John Resig - is a JavaScript Tool Developer for the Mozilla Corporation and the creator and lead developer of the jQuery.
What is jQuery? Is a single JavaScript file. Is a cross-browser JavaScript library (e.g. Dojo, YUI, Prototype, Mochikit, Scriptaculous)designed to simplify the client-side scripting of HTML. It was released in January 2006 at BarCamp NYC by John Resig. An open source functional scripting tool. Syntax is designed to make it easier to navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications. Provides capabilities for developers to create plugins on top of the JavaScript library.
Why use jQuery? Free! (MIT License & GNU GPL v2) Cross browser(IE 6+, Firefox 2+, Safari 3+, Opera 9+ & Chrome 1+) Lightweight (14KB) Extensible Fully documented (http://docs.jquery.com/Main_Page) Templating engine Unit test (QUnit) Documentation Generator (JsDoc-Toolkit) Browser extensions (jsshell, FireQuery, etc…) Great community Tons of plugins (DataGrid, Sortable table, etc...)
Who use jQuery?
Where can I get jQuery? jQuery official website http://jquery.com/ Microsoft adopted it within Visual Studio 2010 for use within Microsoft's ASP.NET AJAX framework and ASP.NET MVC Framework Public Servers http://www.asp.net/ajaxlibrary/cdn.ashx#jQuery_Releases_on_the_CDN_0 http://code.google.com/apis/libraries/devguide.html#jquery
How can I use jQuery? Pick compression level Include the library <script type=“text/javascript" src="jquery.min.js"></script> Start coding <script type=“text/javascript" > 	// Put your logic here… </script>
The jQuery object Commonly named:  Also named:
jQuery API jQuery Selector $(*) $(element) $(id) $(class) $(object)                                         $          $. jQuery Command [factory or utility] .doSomething(parameter, …, options, callback); Interchangeable
jQuery UI Provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that can be used to build interactive web applications. Samples Resizable Tabs Accordion Progress Bar Calendar etc…
The focus of jQuery
Find some elements… Full CSS selector 1-3 support Basic XPath Better CSS selector support than most browsers
$(“div”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
$(“#body”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
$(“div#body”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
$(“div.contents p”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
$(“div > div”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
$(“div:has(div)”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
Do something with them DOM Manipulation (append, prepend, remove) Events (click, hover, toggle) Effects (hide, show, slideDown, fadeOut) AJAX (load, get, post)
DOM Manipulation $(“a[target]”) 	.append(“ (Opens in New Window)”); $(“#body”).css({ 	border: “1px solid green”, 	height: “40px” });
Events $(“form”).submit(function(){ 	if ( $(“input#name”).val() == “” ) 	$(“span.help”).show(); }); $(“a#open”).click(function(){ 	$(“#menu”).show(); 	return false; });
Animations $(“#menu”).slideDown(“slow”); Individual properties 	$(“div”).animate({ fontWeight: “2em”, 		width: “+=20%”, color: “green” // via plugin 	}); Callbacks 	$(“div”).hide(500, function(){ 		// $(this) is an individual <div> element 		$(this).show(500); 	});
Ajax $(“#body”).load(“sample.html div > h1”); Before 	<div id=”body”></div> After 	<div id=”body”> 		<h1>Hello, world!</h1> 	</div> $.getJSON(“test.json”, function(js){ 	for ( var name in js ) 	$(“ul”).append(“<li>” + name + “</li>”); });
Chaining You can have multiple actions against a single set of elements $(“div”).hide(); $(“div”).hide().css(“color”,”blue”); $(“div”).hide().css(“color”,”blue”).slideDown();
          jQuery Plugins jQuery Sliders Slider Gallery (http://jqueryfordesigners.com/demo/slider-gallery.html) jQuery Navigation Menu  Icon Dock (http://icon.cat/software/iconDock/0.8b/dock.html) Navigation Tree View  (http://jquery.bassistance.de/treeview/demo/) Many-many more…
jQuery Authoring Extend the jQuery system Add on extra methods 	$(“div”).hideRemove(); Trivial to implement jQuery.fn.hideRemove= function(speed){ 		return this.hide(speed, function(){ 			jQuery(this).remove(); 		}); 	};
jQuery on PageMethods C# jQuery
jQuery and JSON JSON (JavaScript Object Notation) - is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. Sample: 	{ "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] }
jQuery’s LINQ LINQ style functionality for JavaScript. Allows you to work with sets of data using query style syntax to select, order and sort records. Sample: var results = jLinq.from(records)   .ignoreCase()   .startsWith("name", "m")   .or("j")   .is("admin")   .orderBy("age")   .select(); }}
jQuery on SVG Scalable Vector Graphics (SVG) - is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both static and dynamic (i.e. interactive or animated). Sample: <svg width="100%" height="100%" version="1.1“ xmlns="http://www.w3.org/2000/svg"> <rect width="300" height="100“ style="fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)"/>
jQuery Effects IDE Glimmer allows you to easily create interactive elements on your web pages by harnessing the power of the jQuery library. Without having to hand-craft your JavaScript code, you can use Glimmer’s wizards to generate jQuery scripts for common interactive scenarios. Glimmer also has an advanced mode, providing a design surface for creating jQuery effects based on your existing HTML and CSS.
QUnit Qunit - is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery project to test its code and plugins but is capable of testing any generic JavaScript code (and even capable of testing JavaScript code on the server-side). Sample: test("a basic test example", function () { 	ok(true, "this test is fine"); varvalue = "hello"; 	equals("hello", value, "We expect value to be hello"); 	});
jQuery Intelisense in VS http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx jQuery Compressor http://javascriptcompressor.com/ jQuery Learning References www.visualjquery.com & www.learningjquery.com
Questions

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

J query training
J query trainingJ query training
J query training
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
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
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)
 
Java script
Java scriptJava script
Java script
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
 
Jquery
JqueryJquery
Jquery
 
[2019] Spring JPA의 사실과 오해
[2019] Spring JPA의 사실과 오해[2019] Spring JPA의 사실과 오해
[2019] Spring JPA의 사실과 오해
 
Learn css3
Learn css3Learn css3
Learn css3
 
Introduction to j query
Introduction to j queryIntroduction to j query
Introduction to j query
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxSH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
 
Javascript basic programs
Javascript basic programsJavascript basic programs
Javascript basic programs
 
2.java script dom
2.java script  dom2.java script  dom
2.java script dom
 
GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4GDI Seattle - Intro to JavaScript Class 4
GDI Seattle - Intro to JavaScript Class 4
 
jQuery Learning
jQuery LearningjQuery Learning
jQuery Learning
 
Jquery
JqueryJquery
Jquery
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Schemas and soap_prt
Schemas and soap_prtSchemas and soap_prt
Schemas and soap_prt
 

Similar a jQuery

Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltQuickBase, Inc.
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query PresentationVishal Kumar
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoiddmethvin
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
jQuery
jQueryjQuery
jQueryi.omar
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2Geoffrey Fox
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiMuhammad Ehtisham Siddiqui
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQueryPhDBrown
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenerytoddbr
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Guillaume Laforge
 

Similar a jQuery (20)

Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan Diebolt
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
JQuery: Introduction
JQuery: IntroductionJQuery: Introduction
JQuery: Introduction
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
 
Huge web apps web expo 2013
Huge web apps web expo 2013Huge web apps web expo 2013
Huge web apps web expo 2013
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
jQuery
jQueryjQuery
jQuery
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQuery
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 

Último

(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilabledollysharma2066
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做j5bzwet6
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 

Último (9)

(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 

jQuery

  • 2. Things to know first…
  • 3. The JavaScript Ninja! John Resig - is a JavaScript Tool Developer for the Mozilla Corporation and the creator and lead developer of the jQuery.
  • 4. What is jQuery? Is a single JavaScript file. Is a cross-browser JavaScript library (e.g. Dojo, YUI, Prototype, Mochikit, Scriptaculous)designed to simplify the client-side scripting of HTML. It was released in January 2006 at BarCamp NYC by John Resig. An open source functional scripting tool. Syntax is designed to make it easier to navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications. Provides capabilities for developers to create plugins on top of the JavaScript library.
  • 5. Why use jQuery? Free! (MIT License & GNU GPL v2) Cross browser(IE 6+, Firefox 2+, Safari 3+, Opera 9+ & Chrome 1+) Lightweight (14KB) Extensible Fully documented (http://docs.jquery.com/Main_Page) Templating engine Unit test (QUnit) Documentation Generator (JsDoc-Toolkit) Browser extensions (jsshell, FireQuery, etc…) Great community Tons of plugins (DataGrid, Sortable table, etc...)
  • 7. Where can I get jQuery? jQuery official website http://jquery.com/ Microsoft adopted it within Visual Studio 2010 for use within Microsoft's ASP.NET AJAX framework and ASP.NET MVC Framework Public Servers http://www.asp.net/ajaxlibrary/cdn.ashx#jQuery_Releases_on_the_CDN_0 http://code.google.com/apis/libraries/devguide.html#jquery
  • 8. How can I use jQuery? Pick compression level Include the library <script type=“text/javascript" src="jquery.min.js"></script> Start coding <script type=“text/javascript" > // Put your logic here… </script>
  • 9. The jQuery object Commonly named: Also named:
  • 10. jQuery API jQuery Selector $(*) $(element) $(id) $(class) $(object) $ $. jQuery Command [factory or utility] .doSomething(parameter, …, options, callback); Interchangeable
  • 11. jQuery UI Provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that can be used to build interactive web applications. Samples Resizable Tabs Accordion Progress Bar Calendar etc…
  • 12. The focus of jQuery
  • 13. Find some elements… Full CSS selector 1-3 support Basic XPath Better CSS selector support than most browsers
  • 14. $(“div”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 15. $(“#body”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 16. $(“div#body”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 17. $(“div.contents p”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 18. $(“div > div”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 19. $(“div:has(div)”) <div id=”body”> <h2>Some Header</h2> <div class=”contents”> <p>...</p> <p>...</p> </div> </div>
  • 20. Do something with them DOM Manipulation (append, prepend, remove) Events (click, hover, toggle) Effects (hide, show, slideDown, fadeOut) AJAX (load, get, post)
  • 21. DOM Manipulation $(“a[target]”) .append(“ (Opens in New Window)”); $(“#body”).css({ border: “1px solid green”, height: “40px” });
  • 22. Events $(“form”).submit(function(){ if ( $(“input#name”).val() == “” ) $(“span.help”).show(); }); $(“a#open”).click(function(){ $(“#menu”).show(); return false; });
  • 23. Animations $(“#menu”).slideDown(“slow”); Individual properties $(“div”).animate({ fontWeight: “2em”, width: “+=20%”, color: “green” // via plugin }); Callbacks $(“div”).hide(500, function(){ // $(this) is an individual <div> element $(this).show(500); });
  • 24. Ajax $(“#body”).load(“sample.html div > h1”); Before <div id=”body”></div> After <div id=”body”> <h1>Hello, world!</h1> </div> $.getJSON(“test.json”, function(js){ for ( var name in js ) $(“ul”).append(“<li>” + name + “</li>”); });
  • 25. Chaining You can have multiple actions against a single set of elements $(“div”).hide(); $(“div”).hide().css(“color”,”blue”); $(“div”).hide().css(“color”,”blue”).slideDown();
  • 26. jQuery Plugins jQuery Sliders Slider Gallery (http://jqueryfordesigners.com/demo/slider-gallery.html) jQuery Navigation Menu Icon Dock (http://icon.cat/software/iconDock/0.8b/dock.html) Navigation Tree View (http://jquery.bassistance.de/treeview/demo/) Many-many more…
  • 27. jQuery Authoring Extend the jQuery system Add on extra methods $(“div”).hideRemove(); Trivial to implement jQuery.fn.hideRemove= function(speed){ return this.hide(speed, function(){ jQuery(this).remove(); }); };
  • 29. jQuery and JSON JSON (JavaScript Object Notation) - is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. Sample: { "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] }
  • 30. jQuery’s LINQ LINQ style functionality for JavaScript. Allows you to work with sets of data using query style syntax to select, order and sort records. Sample: var results = jLinq.from(records) .ignoreCase() .startsWith("name", "m") .or("j") .is("admin") .orderBy("age") .select(); }}
  • 31. jQuery on SVG Scalable Vector Graphics (SVG) - is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both static and dynamic (i.e. interactive or animated). Sample: <svg width="100%" height="100%" version="1.1“ xmlns="http://www.w3.org/2000/svg"> <rect width="300" height="100“ style="fill:rgb(0,0,255);stroke-width:1; stroke:rgb(0,0,0)"/>
  • 32. jQuery Effects IDE Glimmer allows you to easily create interactive elements on your web pages by harnessing the power of the jQuery library. Without having to hand-craft your JavaScript code, you can use Glimmer’s wizards to generate jQuery scripts for common interactive scenarios. Glimmer also has an advanced mode, providing a design surface for creating jQuery effects based on your existing HTML and CSS.
  • 33. QUnit Qunit - is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery project to test its code and plugins but is capable of testing any generic JavaScript code (and even capable of testing JavaScript code on the server-side). Sample: test("a basic test example", function () { ok(true, "this test is fine"); varvalue = "hello"; equals("hello", value, "We expect value to be hello"); });
  • 34. jQuery Intelisense in VS http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx jQuery Compressor http://javascriptcompressor.com/ jQuery Learning References www.visualjquery.com & www.learningjquery.com