Web Technologies Lecture 8 JQuery. “A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax.

Slides:



Advertisements
Similar presentations
Getting Started with jQuery. 1. Introduction to jQuery 2. Selection and DOM manipulation Contents 2.
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,
CT-376 jQuery Most popular javascript library today Latest version:
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.
Vishal Kumar 06131A1258. Why you’re going to love jQuery!
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 (
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
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 & AJAX. What is JavaScript? An interpreted programming language with object oriented capabilities. Not Java! –Originally called LiveScript,
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
CSS/Photoshop Layouts – Quiz #7 Lecture Code:
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
Jquery Nasrullah. Jquery jQuery is a JavaScript Library. jQuery greatly simplifies JavaScript programming. jQuery is easy to learn.
JavaScript Frameworks Presented by Kyle Goins Also see:
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.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
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.
Creating Dynamic Webpages
1 What is JQuery. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax* interactions.
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
Unit 13 –JQuery Basics Instructor: Brent Presley.
Introduction to jQuery. 2 Objectives When you complete this chapter, you will be able to: Select elements using jQuery syntax Use built-in jQuery functions.
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.
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)
.. 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.
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.
JQuery Fundamentals Introduction Tutorial Videos
What is jQuery?.
-By Yogita Nirmal.
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.
Scrolling Down vs. Multiple Pages
Introduction to Web programming
JQuery.
Building an App with Jquery and Ajax
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
Web Programming Language
..
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Document Object Model.
Web Client Side Technologies Raneem Qaddoura
Murach's JavaScript and jQuery (3rd Ed.)
JQuery.
Presentation transcript:

Web Technologies Lecture 8 JQuery

“A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.” - jQuery.com Write less do more $("p.neat").addClass(“anim").show("slow");

Advantages Easy of use – Simpler syntax and less lines of code Large library set – Many functions for HTML manipulation, animation, event handling, AJAX, etc. Strong open source community – Many libraries – Efficiency and security Great documentation and tutorials

Disadvantages Functionality may be limited – Despite the many libraries, depending on the website complexity raw Javascript may still be required JQuery file is always required – KB which need to be loaded with your website Strain on the client Strain on the server (if your website hosts it) Performance – Vanilla Javascript is faster than JQuery Code is not always shorter – $(this).attr("id") vs. this.id

DOM and JQuery Identification – How do I obtain a reference to the node that I want Traversal – How do I move around the DOM tree Node Manipulation – How do I get or set aspects of a DOM node Tree Manipulation – How do I change the structure of the page

Terminology JQuery function – Global jQuery object or the $ function depending on the context JQuery object – The object returned by the JQuery function that often represents a group of elements Selected elements – The DOM elements that you have selected, most likely by some CSS selector

JQuery function The $ function always (even for ID selectors) returns an array-like object called a JQuery object Example: document.getElementById("id") == $("#myid")[0]; The JQuery object wraps the originally selected DOM objects You can access the actual DOM object by accessing the elements of the jQuery object $ adds extra functionality to DOM elements Passing an existing DOM object to $ will give it the jQuery upgrade Example: var elem = document.getElementById("myelem"); elem = $(elem);

Node selectors Imported from CSS Patterns used to select the element(s) you want to handle

Examples

Writing efficient selector Use IDs if possible – Fast access – $(“#myelement”) Avoid selecting by class only – $(“.myclass”) – Inefficient in older browsers Keep it simple – No more than 2 or 3 qualifiers unless you have a very complex HTML – Example: $(“p#intro em”) instead of $("body #page:first-child article.main p#intro em"); JQuery works from last selector to first – Retrieve best qualified selector first – Example: $("em", $("p#intro")) instead of $(“p#intro em”)

Complex examples All p tags that have no children, but only if they don't have a class of ignore $(“p:empty:not([class=‘ignore’])”) Any p element with the text "REPLACE_ME" in it $(“p:contains(‘REPLACE_TEXT’)”) All div tags with a child that has a class of special $(“div”).children(“.special”) All heading elements (h1, h2, h3, h4, h5, h6) $(“h1,h2,h3,h4,h5,h6”) Every other visible li $(“li:even:visible”)

Handling events, CSS, animations $(document).ready(function() { $("button").click(function() { $("p").css("background-color", "yellow"); }); $("button").click(function() { $("div").animate( { left: '250px', opacity: '0.5', height: '150px', width: '150px' }); });

What’s next? Server side programming Web services Cloud computing