JQuery. What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling.

Slides:



Advertisements
Similar presentations
JavaScript – Quiz #8 Lecture Code:
Advertisements

The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
JQuery CS 380: Web Programming. What is jQuery? jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling,
JQuery A Javascript Library Hard things made eas(ier) Norman White.
Building a Rich Internet Application with jQuery Ben Dewey twentysix New York Fill this space.
Sep 2010 Palestinian Land Authority IT Department By Salam Turkman1 Jquery (write less do more)
Vishal Kumar 06131A1258. Why you’re going to love jQuery!
CS428 Web Engineering Lecture 15 Introduction to Jquery.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
JQuery CS 268. What is jQuery? From their web site:
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
Nguyen Ich Cuong.  Course duration: 45’  Purpose: Present Introduction to JQuery  Targeted attendees: NICorp Trainee  Tests/quiz: Yes - 10’
What is jQuery?  JavaScript Library  Functionality  DOM scripting & event handling  Ajax  User interface effects  Form validation 2.
JQuery March 09 th,2009 Create by
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
Review IDIA 619 Spring 2013 Bridget M. Blodgett. HTML A basic HTML document looks like this: Sample page Sample page This is a simple sample. HTML user.
13. jQuery See the official documentation at  See the terse API documentation at
Jquery Nasrullah. Jquery jQuery is a JavaScript Library. jQuery greatly simplifies JavaScript programming. jQuery is easy to learn.
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
JavaScript Frameworks Presented by Kyle Goins Also see:
Conor Russomanno & Elizabeth Umbrino. A popular free Javascript Library Released in January 2006 At BarCamp, an international network of user-generated.
JQuery Fairway Code Brew. Agenda What is jQuery? No, really, what is it? Show me something cool Why should I use it? Disturbing photo More features FlexBox.
Animation & Effects Using JQuery. What is jQuery? jQuery is a lightweight, JavaScript library. The purpose of jQuery is to make it much easier to use.
JQuery Youn-Hee Han
. Taught by: Muhammad Ali Baloch midahot. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between.
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
Introduction to jQuery. jQuery Quick facts Is a cross-compatible JavaScript library Released in 2006 by John Resig Simplifies HTML document traversing,
Fundamentals, Ajax, Templates, UI Doncho Minkov Telerik Corporation
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
LOGO sparcs.org 1 jQuery Tutorial Presenter ㅎㅇㅎㅇ.
JavaScript Library. What is jQuery jQuery is a lightweight JavaScript library. The purpose is to make it easier to use JavaScript code on your website.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help.
JQuery Overview Unleash the Power of jQuery SoftUni Team Technical Trainers Software University
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
1 What is JQuery. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax* interactions.
Unit 13 –JQuery Basics Instructor: Brent Presley.
Web Technologies Lecture 8 JQuery. “A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax.
SHAREPOINT & JQUERY. Hi, my name and I am a product manager at lightning tools. I have been working with SharePoint for 5 years.
Introduction to JQuery COGS 187A – Fall JQuery jQuery is a JavaScript library, and allows us to manipulate HTML and CSS after the page has been.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
JQuery “write less, do more”. jQuery - Introduction Simply a JavaScript library to simplify JavaScript programming itself Wraps long standard JavaScript.
JQUERY AND AJAX
.. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between HTML and JavaScript. The jQuery library.
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
Shaun Geisert Matt Trice. What is jQuery?  Open source Javascript library/framework Created by John Resig  Their tagline – “The Write Less, Do More.
SharePoint & jQuery. About me Phill Duffy – Product Manager at Lightning Tools Ltd – Author of ‘Pro SharePoint with jQuery’ – MCTS Application Developer.
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery.
JQuery Fundamentals Introduction Tutorial Videos
What is jQuery?.
12/04/12 JQuery I took these slides from the site because they were pretty good looking. Instructions for editing school and department titles: Select.
Tek Raj Chhetri Code for Humans not for machine.
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
JQuery.
JQUERY Online TRAINING AT GOLOGICA
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
..
MIS JavaScript and API Workshop (Part 2)
Getting started with jQuery
Javascript and JQuery SRM DSC.
Document Object Model.
Introduction to jQuery
Presentation transcript:

jQuery

What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling animation Ajax interactions for rapid web development

jQuery: the most popular JS library

jQuery: the most popular JS library

History First released in January 2006 at BarCamp NYC by John Resig Latest stable releases: / July 3, / July 3, 2013

Downloading jQuery Library is distributed as jqueryXXX.js Available in two formats Compressed Uncompressed Library size: 32 KB (production mode: minified and gzipped) 91.6 KB 247 KB (development mode: uncompressed)

jQuery features DOM element selections (cross-browser) DOM traversal and modification Events CSS manipulation Effects and animations Ajax Extensibility through plug-ins Utilities - user agent info, feature detection

Adding jQuery to the project // add JavaScript and jQuery code here

CDN hosted jQuery A number of large enterprises provide hosted copies of jQuery on existing CDN networks that are available for public use CDN = Content delivery network So, you can simply use hosted library, i.e.

How to start jQuery homepage provides a large number of tutorials, as well as detailed documentation and API reference Good starting point is “How jQuery Works” article by jQuery author John Resig

Ready event for the document Most usually jQuery is used to read or manipulate the document object model (DOM) It is necessary to ensure that jQuery code is executed (e.g. event handlers are added) as soon as the DOM is ready Register a ready event for the document: $(document).ready(function() { // do stuff when DOM is ready alert("Hello :)"); });

Checking that jQuery works JavaScript alert will appear after each page refresh: window.onload = function(){ alert("welcome"); }

Another simple jQuery example Show an alert when clicking a link: $(document).ready(function() { $("a").click(function() { alert("Click on Link!"); }); $("a") - jQuery selector, which selects all elements on the page click() - binds a click event to all selected elements

Using Selectors jQuery provides two approaches to select elements: 1.a combination of CSS and XPath selectors passed as a string to the jQuery constructor $("div > ul a") 2.using several methods of the jQuery object All further examples are taken from

Using Selectors document.getElementById("id") $(document).ready(function() { $("#id").addClass("red"); }); JavaScript: jQuery:.red { color: red; }

Using Selectors $(document).ready(function() { $("#orderedlist > li").addClass("blue"); }); Selecting child elements: Selects all child li -s of the element with the id orderedlist and adds the class "blue".

Using Selectors $(document).ready(function() { $("#orderedlist li:last").hover(function() { $(this).addClass("green"); },function(){ $(this).removeClass("green"); }); Add and remove the class when the user hovers the li element, but only on the last element in the list:

Using Selectors $(document).ready(function() { $("#orderedlist").find("li").each(function(i) { $(this).append( " BAM! " + i ); }); What does this code do?

Using Events For every JavaScript onxxx event available, like onclick, onchange, onsubmit, there is a jQuery equivalent

Doing Ajax with jQuery Sending GET Ajax request: jQuery.get( url [, data] [, success(data, textStatus, jqXHR)] [, dataType] ) url: a string containing the URL data: a map or string that is sent to the server with the request success(data, textStatus, jqXHR): a callback function that is executed if the request succeeds dataType: the type of data expected from the server.

Spring Controller for Ajax public class = "/subscribeAsync/{id}", method = RequestMethod.POST) public String String id) { // do processing // send response return "Done"; } api/org/springframework/web/bind/annotation/ResponseBody.html

Doing Ajax with jQuery Fetch the requested HTML snippet and insert it on the page $.get('ajax/test.html', function(data) { $('.result').html(data); alert('Load was performed.'); });

Doing Ajax with jQuery Rating example: $(document).ready(function() { // generate markup $("#rating").append("Please rate: "); for (var i = 1; i <= 5; i++ ){ $("#rating").append( " " + i + " "); } … … …

Doing Ajax with jQuery // add markup to container and apply click handlers $("#rating a").click(function(e){ e.preventDefault();// stop normal link click // send request $.post("rate.php", {rating: $(this).html()}, function(xml) { // format and output result $("#rating").html( "Thanks for rating, current average: " + $("average", xml).text() + ", number of votes: " + $("count", xml).text() ); });

Animations and Effects Simple animations with jQuery can be achieved with show() and hide() $(document).ready(function(){ $("a").toggle(function(){ $(".stuff").hide('slow'); },function(){ $(".stuff").show('fast'); }); toggle() – bind two or more handlers to the matched elements, to be executed on alternate clicks hide(),show() – effects to hide/show the matched elements

jQuery UI Provides abstractions for low-level interaction and animation, advanced effects and high- level, themeable widgets that you can use to build highly interactive web applications Interactions Widgets Utilities Effects

References jQuery homepage