Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.

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

CT-376 jQuery Most popular javascript library today Latest version:
JQuery A Javascript Library Hard things made eas(ier) Norman White.
Fall 2012 CSC9010 Web Technologies Web Tool Presentation Randy Escoto.
Computer Information System Information System California State University Los Angeles Jongwook Woo CIS 461 Web Development I JQuery Part I Jongwook Woo,
CS428 Web Engineering Lecture 15 Introduction to Jquery.
ICS 665 Jesse Abdul. jQuery UI Overview  jQuery UI javascript library Includes all UI component functionality  jQuery UI CSS framework Includes standard.
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.
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.
M. Taimoor Khan Courtesy: Norman White.
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’
JavaScript & jQuery the missing manual Chapter 11
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),
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.
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
CHAPTER 5 jQuery อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
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 Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Browser scripting jQuery Edited by: Trần Thị Mỹ Dung Ref:w3schools.com.
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.
Creating Dynamic Webpages
JQuery Overview Unleash the Power of jQuery SoftUni Team Technical Trainers Software University
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
Unit 13 –JQuery Basics Instructor: Brent Presley.
Understanding JavaScript and Coding Essentials Lesson 8.
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.
KAPITA SELEKTA INFORMATIKA Lasmedi Afuan, ST.M.Cs.
LECTURE #4: JQUERY AND FORM VALIDATION Josh Kaine Josh Kaine 4/1/2016.
Designing and Developing Apps CIS 136 Building Mobile Apps 1.
JQuery Tutorial. What is jQuery jQuery is a JavaScript Library The purpose of jQuery is to make it much easier to use JavaScript on your website JavaScript.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery Element & Attribute Selectors, Events, HTML Manipulation, & CSS Manipulation.
JQuery.
What is jQuery?.
Introduction to.
-By Yogita Nirmal.
Tek Raj Chhetri Code for Humans not for machine.
Unleash the Power of jQuery
Intro to jQuery jQuery is a popular, and extensible, JavaScript library Supports … DOM manipulation CSS manipulation HTML event methods Effects & animations.
CGS 3066: Web Programming and Design Spring 2017
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
JQuery.
JQUERY Online TRAINING AT GOLOGICA
Fundamentals, DOM, Events, AJAX, UI
The Cliff Notes Version
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
Document Object Model.
Web Programming Language
JQuery.
Presentation transcript:

Intro to jQuery

What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event handling, animations, and more "write less, do more"

Minification Removal of all unnecessary characters in code e.g. whitespace new line chars, and comments Reduces amount of data needed to be transferred Smaller file size = quicker page loads, but less readability A lot of tools that compress the source code for you jscompress.com is just one

How to Add jQuery Lastest stable version is Download it and store locally Use the hosted jQuery library src=" ery.min.js"> src=" min.js">

jQuery Syntax $(selector).action(); $ (typically) used to define jQuery Selector - HTML element to "query" or find Action - What to do jQuery action to perform

Defining jQuery $ is shorthand for the standard function (full name is jQuery) $(document).ready = jQuery(document).ready Syntactically the same Problem: '$' is used as shorthand for other JavaScript library objects There's a way to get around this: jQuery noConflict() method Ex. var jq = jQuery().noConflict(); jq(document).ready( function () { jq("p").hide(); } );

Event Handlers jQuery methods called when an event is "triggered" or "fired" It's common to put most jQuery functions within $ (document).ready(function) This waits until the entire page is loaded $(document).ready(function() { $("p.change").click(function() { //do something here } );

jQuery Selectors Allow you to manipulate/traverse HTML DOM element There are 3 types of jQuery Selectors (Think of the CSS lectures!)

Element Selectors jQuery uses CSS to select HTML elements $("h1") - selects all elements $("p.fname") - selects all with the class = "fname" $("h2#lname") - selects the with the id = "lname" $("#contact") - selects all elements with id = "contact" (There should only be one!) element-selectors.html

Attribute Selectors jQuery uses XPath to select elements with the given attributes $("[href]") - selects all elements with the href attribute $("[name = 'fname']") - selects all elements where the name attribute is equal to "fname" $("[href !='#']") - selects all elements with href attribute does NOT equal "#" attribute-selectors.html

CSS Selectors Changes the CSS properties of the HTML elements $(selector).css("css-property", "value"); Can pass just the property to get the current value (the first matched element is returned) Can pass multiple properties $("h1").css("color", "green") - changes the color of all h1 elements to green $("h1").css({"background-color":"yellow","font- size":"200%"}) - changes all h1 elements to have a background color yellow and font size to 200% css-selectors.html

jQueryHTML Manipulation jQuery gives you some methods to manipulate the DOM.addClass() - lets you add one or more classes to the element.html() - sets or returns the content (innerHTML) of a element.before() - adds content before the given element.val() - sets or gets the value of a (form) element html- manipulation.htmlhtml- manipulation.html

jQueryHTML Manipulation Cont. Ok cool, but what about this: You dynamically add a new element (via jQuery or some other method) and want to bind an event to it. You can use the.on() method $(parent-element-to-monitor).on("event(s)", "element- to-attach-event", eventHandler()); Ex. $(document).on( "click", "p", function(event) { alert("Cool text here!"); } ); jq-on.html

jQueryEffects The "old" way to do hide, show, slide, toggle, fade, and animate. (A lot of this can be done with CSS3 now). $("p#hideme").hide() - hides the p element with the id $("h1").fadeIn() - does a fade in animation to all h1 elements

jQuery Effects (Callbacks) cont. The callback parameter Waits to execute a function until after the parent function is executed Useful since JavaScript is a interpreted language Since JS executes line by line

jQuery Effects (Callbacks) cont. What's the difference between these two functions? $("p").hide(1000); alert("The paragraph is now hidden"); $("p").hide(1000,function(){ alert("The paragraph is now hidden"); } ); callback.html

jQuery UI Official jQuery user interface library Basically a set of useful/"official" jQuery plugins Convient UI interactions Useful widgets Cool effects Easy to use theme framework

Using jQuery UI Lastest stable version is Lets you download only things you want Just have to include the.js and.css files on your pages

Some basic UI interactions Draggable - lets you make any DOM elements draggable Resizable - lets you resize any DOM element Selectable - makes a DOM element, or group of elements, selectable jqui-interactions.html

Useful widgets Datepicker - A highly configurable UI datepicker Autocomplete - Allows a Google Search like autocomplete function Button - Makes making things that aren't typically buttons be buttons Tabs - Used to break content into different sections Dialog - Similar to JS alert, but more configureable jqui-widgets.html

jQuery UI Effects Basically some convenience methods that extend the functionality of jQuery Animate - extends the core jQuery animate function to animate by color Hide/Show - enables animation for the effects switchClass - lets you switch from one class to another

jQuery UI Themes jQuery UI plugins are all styled by CSS (both the core jQuery UI style and plugin specific style) Makes it easy to keep the look and feel consistent Given the ability to create your own customized theme

examples.html for all the examples and more resources.