JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,

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/AJAX ALIREZA KHATAMIAN DELARAM YAZDANSEPAS.
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.
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.
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
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’
Sascha Wener.  Definition from Microsoft Developer Network: “A theme is a unified set of design elements and color schemes that you apply to pages to.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
Interacting with a Web Page using JavaScript Mat Kelly GTAI Presentation January 10, 2014.
JQuery Write less, do more…. Lecture Plan jQuery – what and why The ready function Creating Content Changing Elements Applying CSS Applying functions.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
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
. Taught by: Muhammad Ali Baloch midahot. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between.
JQuery Javascript Library. JQuery Powerful JavaScript library –Simplify common JavaScript tasks –Access parts of a page using CSS or XPath-like expressions.
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.
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
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
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.
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.
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.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
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.
.. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between HTML and JavaScript. The jQuery library.
JQuery Element & Attribute Selectors, Events, HTML Manipulation, & CSS Manipulation.
JQuery Fundamentals Introduction Tutorial Videos
What is jQuery?.
Getting Started with CSS
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.
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
Introduction to Web programming
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
JQuery.
JQUERY Online TRAINING AT GOLOGICA
The Cliff Notes Version
DHTML Javascript Internet Technology.
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
DHTML Javascript Internet Technology.
Cascading Style Sheets (Introduction)
Web Programming Language
..
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Document Object Model.
Web Client Side Technologies Raneem Qaddoura
Web Programming and Design
Web Programming and Design
JQuery.
Presentation transcript:

jQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation, and ajax much simpler with an easy-to-use API that works across a multitude of browsers.

WHAT CAN IT DO? Change content based on user actions Toggle CSS classes to highlight an element Makes it easy to: Find elements in the DOM Change content Listen to what the user does Animation content on the page Talk over network to fetch new content

HOW TO GET THE LIBRARY: METHOD 1 Download it from here: Site Features lots of API/documentation Load into your page: Make sure it is first script included if you also include your own js file that uses it

JQUERY IMPROVES OUR CODE EXAMPLE: OBTRUSIVE JAVASCRIPT

OUR FORM VALIDATION EXAMPLE Separate most of the JavaScript in its own.js file Styles have been separated out into a style sheet BUT….we still have calls to the functions appearing within our html in the form elements

GOAL = COMPLETE SEPARATION Idea is called Unobtrusive JavaScript Considers any JS embedded in the to be incorrect This includes attributes of HTML elements (such as onblur ) Using the jQuery library, we can achieve complete separation of style, behavior, and structure

HOW TO GET THE LIBRARY: OPTION 2 Quicker/Easier Use a Google-hosted library by grabbing the snippet from here: eed/libraries/#jquery Add snippet code in your page above your own js

JQUERY FUNCTION In General – format is: jQuery( ); Shorthand Equivalent: $( );

DON’T WANT TO DO ANYTHING UNTIL DOM FINISHES LOADING Determine using ready function The DOM Event triggers once page fully loaded

FINDING NODES (ELEMENTS) IN THE DOM Just need to use their CSS selectors To grab this and this, just use regular CSS selector that would get them

TO ACCESS TEXT INSIDE AN ELEMENT.text() Equivalent to JS.innerHTML.text() retrieves current contents.text(“new value”) sets to new value

EXAMPLE HTML jQuery Result

FIND BASED ON ID OR CLASS ID’s: $(“#whateverId”) Classes: $(“.whateverClass”)

MORE SUB-SELECTION – STILL JUST BASED ON WHAT CSS WOULD LOOK LIKE $("p a") Retrieves any links nested inside a element $("div.exampleClass") Retrieves any element with class exampleClass

EXAMPLE HTML

EXAMPLE - CONTINUED CSS jQuery Result EVERY li descendent of #favs is selected

SELECTING MULTIPLE ELEMENTS Again, just like CSS List them with comma in between Example: $(“.movies, #foods”) Selects elements with class movies or id foods

PSEUDO-CLASSES li:first  only selects 1 st list item li:last  only selects last li li:odd  only selects odd li’s li:even  only selects even li’s

PERFORM AN OPERATION Once set is retrieved, can perform operations on it Basic Syntax: $(selector).action( ) Example: $("div.exampleClass").hide(); This will hide any element with class exampleClass

CAN DAISY-CHAIN OPERATIONS tack various transformations together with additional periods Example: $("div.ex").hide().addClass("removed"); The code 1 st hides any with class ex and then adds an additional class to all of the these same elements called removed

RESPOND TO AN EVENT $(document).ready(function(){ $("selector").event(function(){ /*do whatever in response */ });

EXAMPLE $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); This is a heading This is a paragraph. This is another paragraph. Click me