What is jQuery?  JavaScript Library  Functionality  DOM scripting & event handling  Ajax  User interface effects  Form validation 2.

Slides:



Advertisements
Similar presentations
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,
Advertisements

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.
JQuery & SharePoint San Antonio Users Group – September Meeting September 22, 2009 Microsoft SharePoint Server.
1 Hottest SharePoint Buzz Ever … JPoint Fernando Leitzelar, PMP Sr. SharePoint Developer.
JQuery. What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
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 (
JQuery CS 268. What is jQuery? From their web site:
Getting Started.  jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions.
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’
JQuery Javascript Framework Aryo Pinandito. A Little Bit About jQuery  jQuery is an Open-Source JavaScript framework that simplifies cross-browser client.
JQuery March 09 th,2009 Create by
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Lecture 11 – DOM Scripting SFDV3011 – Advanced Web Development Reference: 1.
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),
JQuery Write less, do more…. Lecture Plan jQuery – what and why The ready function Creating Content Changing Elements Applying CSS Applying functions.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
13. jQuery See the official documentation at  See the terse API documentation at
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
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 II DOM & JSON. In an effort to create increasingly interactive experiences on the web, programmers wanted access to the functionality of browsers.
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.
AJAX (also known as: XMLHTTP, Remote Scripting, XMLHttpRequest, etc.) Matt Warden.
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
Fundamentals, Ajax, Templates, UI Doncho Minkov Telerik Corporation
JQuery Javascript Library. JQuery Powerful JavaScript library –Simplify common JavaScript tasks –Access parts of a page using CSS or XPath-like expressions.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
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.
Web Programming Language Week 9 Dr. Ken Cosh Introducing jQuery.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
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.
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
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.
CHAPTER 7 JQUERY WHAT IS JQUERY? jQuery is a script. It is written in JavaScript.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
DOM & Jquery Nov. 09, Jquery JavaScript Library DOM (Document Object Model) HTML/XML/etc. Ajax (Asynchronous JavaScript and XML)
David Tarrant Electronics and Computer Science.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
.. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between HTML and JavaScript. The jQuery library.
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery.
Jquery L. Grewe.
Vinay Vasyani Internet Programming
CS5220 Advanced Topics in Web Programming JavaScript and jQuery
Intro to jQuery jQuery is a popular, and extensible, JavaScript library Supports … DOM manipulation CSS manipulation HTML event methods Effects & animations.
Introduction to Web programming
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
..
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Document Object Model.
Web Client Side Technologies Raneem Qaddoura
Web Programming and Design
Presentation transcript:

What is jQuery?  JavaScript Library  Functionality  DOM scripting & event handling  Ajax  User interface effects  Form validation 2

Why jQuery?  Lightweight – 14kb (Minified and Gzipped)  Cross-browser support (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)  CSS-like syntax – easy for developers/non- developers to understand  Active developer community  Extensible - plugins 3

JQuery  Powerful JavaScript library  Simplify common JavaScript tasks  Access parts of a page  using CSS or XPath-like expressions  Modify the appearance of a page  Alter the content of a page  Change the user’s interaction with a page  Add animation to a page  Provide AJAX support  Abstract away browser quirks

Example – Show/Hide the old way Click here to toggle visibility of #foo function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } 5

Example – Show/Hide with jQuery $().ready(function(){ $("a").click(function(){ $("#more").toggle("slow"); return false; }); 6

Introductory Sample Cities of the World Paris Chic, fashionable, expensive rude Sydney Opera house but no culture, Mardi Gras, fireworks h1 {font-size: 2.5em; margin-bottom: 0;}.emphasize {font-style: italic; color:red;}

Basic JQuery  Selecting part of document is fundamental operation  A JQuery object is a wrapper for a selected group of DOM nodes  $() function is a factory method that creates JQuery objects  $(“dt”) is a JQuery object containing all the “dt” elements in the document

Basic JQuery .addClass() method changes the DOM nodes by adding a ‘class’ attribute  The ‘class’ attribute is a special CSS construct that provides a visual architecture independent of the element structures  $(“dt”).addClass(“emphasize”) will change all occurrences of to  See also.removeClass()

Basic JQuery  To make this change, put it in a function and call it when the document has been loaded and the DOM is created function doEmph(){$(“dt”).addClass(“emphasize”)}  We had to alter the HTML (bad)  Structure and appearance should be separated!  Also, onLoad waits until all images etc are loaded. Tedious.

Basic JQuery  JQuery provides an independent scheduling point after DOM is created and before images are loaded  $(document).ready(doEmph);  No HTML mods required. All done in script.  Better solution:  $(document).ready(function(){ $(“dt”).addClass(“emphasize”) }); …

JQuery Selectors  CSS pelement name #ididentifier.classclassname p.classelement with class p aanchor as any descendant of p p > aanchor direct child of p

JQuery Selectors  XPath /html/body//divpaths with an href attr div[ol]div with an ol inside anchor with a specific value for the ref attribute

JQuery Filters p:firstfirst paragraph li:lastlast list item a:nth(3)fourth link a:eq(3)fourth link p:even or p:oddevery other paragraph a:gt(3) or a:lt(4)every link after the 4th or up to the fourth a:contains(‘click’)links that contain the word click

Example  JQuery uses chaining as follows $(‘a:contains("ECS")’).parent().addClass("emphasize")

JQuery Events  bind(eventname, function) method  ‘click’  ‘change’  ‘resize’  $(this).addClass(‘red’);});

Other JQuery Effects .css(‘property’, ‘value’) .css({‘prop1’:‘value1’, ‘prop2’:’value2’…})  E.g..css(‘color’, ‘red’) .hide(speed) or.show(speed)  Where speed is ‘slow’, ‘normal’ or ‘fast’

More JQuery Changes DOM .attr({‘name’, ‘value’})  sets a new attribute (or many)  $(‘ hello ’)  Creates a new element  $(‘ hello ’).insertAfter(‘div.chapter p’);  Creates element and inserts it into the document .html() or.text() or.empty() will replace matched elements with newly created elements

Example – Show/Hide the old way Click here to toggle visibility of #foo function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } 19

Example – Show/Hide with jQuery $().ready(function(){ $("a").click(function(){ $("#more").toggle("slow"); return false; }); 20

Example – Ajax the old way 21 function GetXmlHttpObject(handler) { var objXmlHttp = null; //Holds the local xmlHTTP object instance //Depending on the browser, try to create the xmlHttp object if (is_ie){ var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP'; try{ objXmlHttp = new ActiveXObject(strObjName); objXmlHttp.onreadystatechange = handler; } catch(e){ //Object creation errored alert('Verify that activescripting and activeX controls are enabled'); return; } else{ // Mozilla | Netscape | Safari objXmlHttp = new XMLHttpRequest(); objXmlHttp.onload = handler; objXmlHttp.onerror = handler; } //Return the instantiated object return objXmlHttp; }

Example – Ajax with jQuery $.get(“controller/actionname", { name: "John", time: "2pm" }, function(data){ alert("Data Loaded: " + data); }); $.post(“controller/actionname", { name: "John", time: "2pm" }, function(data){ alert("Data Loaded: " + data); }); 22

Example – Form Validation $().ready(function() { // validate the comment form when it is submitted $("#commentForm").validate(); }); 23