JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),

Slides:



Advertisements
Similar presentations
Getting Started with jQuery. 1. Introduction to jQuery 2. Selection and DOM manipulation Contents 2.
Advertisements

Table (TABLE) Contains TABLE ROWS (TR) Contains TABLE DATA (TD) Data can contain anything Text Lists Other tables Pictures …
JQuery CS 380: Web Programming. What is jQuery? jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, 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 (
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
Getting Started.  jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions.
4.1 JavaScript Introduction
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
What is jQuery?  JavaScript Library  Functionality  DOM scripting & event handling  Ajax  User interface effects  Form validation 2.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
Styling and theming Build campaigns in style. What we'll look at... How a web document is structured How HTML and CSS fit together Tools you will need.
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
HTML | DOM. Objectives  HTML – Hypertext Markup Language  Sematic markup  Common tags/elements  Document Object Model (DOM)  Work on page | HTML.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
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.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 7.
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.
. 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
JQuery Javascript Library. JQuery Powerful JavaScript library –Simplify common JavaScript tasks –Access parts of a page using CSS or XPath-like expressions.
An Introduction to JavaScript By: John Coliton Tuesday, November 10, 1998 Center for Teaching and Learning.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
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.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Unit 13 –JQuery Basics Instructor: Brent Presley.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
Web Technologies Lecture 8 JQuery. “A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
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.
CHAPTER 7 JQUERY WHAT IS JQUERY? jQuery is a script. It is written in JavaScript.
JQuery “write less, do more”. jQuery - Introduction Simply a JavaScript library to simplify JavaScript programming itself Wraps long standard JavaScript.
JQuery Animation. If you look at example1.html, you will see that it is a basic web page with links to the jquery library, and a script.js file and some.
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.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery.
CSCI 1720 W3.CSS – Part 1 East Tennessee State University Department of Computing CSCI 1720 Intermediate Web Design.
Programming Web Pages with JavaScript
CGS 3066: Web Programming and Design Spring 2017
Introduction to Web programming
HTML.
CS3220 Web and Internet Programming Client-Side JavaScript and jQuery
Introduction to JavaScript
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
Introduction to JavaScript
Document Object Model (DOM): Objects and Collections
..
An introduction to jQuery
E-commerce Applications Development
Document Object Model.
Introduction to JavaScript
HTML and CSS Basics.
Chengyu Sun California State University, Los Angeles
Introduction to JavaScript
Murach's JavaScript and jQuery (3rd Ed.)
Week 5: Recap and Portfolio Site
Presentation transcript:

JQUERY | INTRODUCTION

jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM), and  JavaScript. JAVASCRIPT Jquery Cookbook, 2010

HTML Tree - DOM My Web Page Main Topic A web page about the days of the week, specifically Tuesday.

HTML Tree - DOM Ancestor to all tags Ancestor to h1, p, strong Siblings Child of Descendent of Descendent of and

Why use jQuery  It’s open source. It’s free.  It’s small (18 KB minified).  It normalizes differences between web browsers.  It’s documented.  It’s currently tested and optimized for development on modern browsers (Chrome IE, Opera, Safari, Firefox).  It’s powerful.  It’s adopted by large organizations.  Learning curve is not steep. Jquery Cookbook, 2010

The jQuery Foundation  Can be broken down into three concepts: 1. Finding elements (via CSS selectors) and doing something with them (via jQuery methods) 2. Chaining multiple jQuery methods 3. Using jQuery wrapper set and implicit iteration Jquery Cookbook, 2010

1. Find some elements and do something with them  Locate a set of elements in the DOM, and then do something with that set of elements. Scenario – suppose we wanted to 1. hide a from user 2. put new text content into the hidden, 3. change style of the, and 4. make hidden visible again. Jquery Cookbook, 2010

1. Find some elements and do something with them //hide all divs on the page jQuery('div').hide(); //update the text contained inside of all divs jQuery('div').text('This is content for the DIV element'); //add class attribute with value of updatedContent to all divs jQuery('div').addClass("updatedContent"); //show all divs on the page jQuery('div').show(); Jquery Cookbook, 2010

This is existing content //hide all divs on the page jQuery('div').hide(); //update the text contained inside of all divs jQuery('div').text('This is content for the DIV element'); //add a class attribute of updatedContent to all divs jQuery('div').addClass("updatedContent"); //show all divs on the page jQuery('div').show(); Jquery linked library and script at end of document

This is old content //hide all divs on the page jQuery('div').hide(); //update the text contained inside of all divs jQuery('div').text('This is new content'); //add a class attribute updatedContent to all divs jQuery('div').addClass("updatedContent"); //show all divs on the page jQuery('div').show(); Jquery local library and script at end of document

1. Find some elements and do something with them What we did:  Use jQuery function (jQuery()) to find all the elements in the HTML page  Use jQuery methods to do something with them (e.g., hide(), text(), addClass(), show()).  Methods |.hide(),.text(),.addClass(),.show() Jquery Cookbook, 2010

2. Chaining  jQuery allows methods (e.g., hide(), text(), addClass(), show(), etc.) to be chained.  Find element once and then chain operations onto that element. Jquery Cookbook, 2010

2. Chaining  Can apply endless chain of jQuery methods on elements that are selected using jQuery function.  Cuts down on processing overhead by selecting a set of DOM elements only once, to be operated on numerous times by jQuery methods Jquery Cookbook, 2010

jQuery('div').hide(); jQuery('div').text('This is new content'); jQuery('div').addClass("updatedContent"); jQuery('div').show(); jQuery('div').hide().text('new content').addClass("updatedContent").show(); jQuery('div').hide().text('new content').addClass("updatedContent").show(); Chained Not Chained Chained

3. The jQuery wrapper set  DOM elements from an HTML page are wrapped with jQuery functionality.  Wrapper set will contain one DOM element; other times it will contain several.

This is content jQuery('div').hide().text('new content').addClass("updatedContent").show(); Jquery wrapped set jQuery scans page and places all elements in wrapper set so that the jQuery methods are performed on each DOM element in the set: implicit iteration

This is old content repeat (i==numofDivs) begin $ (‘div’). hide(); end Jquery wrapped set. It is like jQuery is performing a repeat loop. jQuery scans page and places all elements in wrapper set so that the jQuery methods are performed on each DOM element in the set: implicit iteration

jQuery function  $(document).ready()  jQuery (document).ready()

Executing jQuery/JavaScript Coded After the DOM Has Loaded but Before Complete Page Load  ready() event handler method  $(document).ready() or jQuery (document).ready()  Included in your web pages after the stylesheet.  Necessary if JavaScript has to be embedded in the document flow at the top of the page and encapsulated in the element.

Executing jQuery/JavaScript Coded After the DOM Has Loaded but Before Complete Page Load $(document).ready(function() { $('div').hide().text('new content').addClass("updatedContent").show(); });