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

Slides:



Advertisements
Similar presentations
Diego Guidi - DotNetMarche. DOM tree is clunky to use No multiple handlers per event No high-level functions Browser incompatibilities = jQuery to the.
Advertisements

JavaScript – Quiz #8 Lecture Code:
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
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,
Programming Club IIT Kanpur. Work environment Before you begin coding,always set up your work environment to your needs IDE Notepad++ Sublime Text 2.
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.
JQuery The Way to JavaScript and Rich Internet Applications.
Building a Rich Internet Application with jQuery Ben Dewey twentysix New York Fill this space.
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
CS428 Web Engineering Lecture 15 Introduction to Jquery.
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
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
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),
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.
CHAPTER 5 jQuery อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
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.
HTML.
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.
JQuery Overview Unleash the Power of jQuery SoftUni Team Technical Trainers Software University
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.
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.
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.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
JQuery The Write Less, Do More, JavaScript Library.
.. 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.
SharePoint & jQuery. About me Phill Duffy – Product Manager at Lightning Tools Ltd – Author of ‘Pro SharePoint with jQuery’ – MCTS Application Developer.
JQuery.
JQuery Fundamentals Introduction Tutorial Videos
Programming Web Pages with JavaScript
Tek Raj Chhetri Code for Humans not for machine.
Unleash the Power of jQuery
Human Computer Interaction
CGS 3066: Web Programming and Design Spring 2017
Introduction to Web programming
JQUERY Online TRAINING AT GOLOGICA
CS3220 Web and Internet Programming Client-Side JavaScript and jQuery
Fundamentals, DOM, Events, AJAX, UI
The Cliff Notes Version
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
Introduction to jQuery
..
MIS JavaScript and API Workshop (Part 2)
Getting started with jQuery
An introduction to jQuery
E-commerce Applications Development
Document Object Model.
An introduction to jQuery
Chengyu Sun California State University, Los Angeles
Getting started with jQuery
An introduction to jQuery
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

Getting Started with jQuery

1. Introduction to jQuery 2. Selection and DOM manipulation Contents 2

What is jQuery? Why use jQuery? Getting jQuery 1. Getting Started with jQuery 3

jQuery is a free, open-source JavaScript library Dramatically simplifies the task of writing client-side JavaScript code in your Web pages Hides browser-specific nuances, which is a great help! Simplifies Ajax calls The success story of jQuery First released in 2006 Widely adopted by major Web platforms, including Microsoft IE6+, Chrome, Firefox 2+, Safari3+, Opera 9+ What is jQuery? 4

Here are some of the reasons jQuery is so popular: Cross-browser compatibility Fast and small Short learning curve and great documentation Many plug-ins available Compliant with CSS3 selectors Helpful utilities jQuery UI Widespread adoption Why use jQuery? 5

You can download jQuery from You can then incorporate jQuery in a page as follows: You can access directly at Microsoft CDN or Google CDN You can then incorporate jQuery in a page using one of the following: Getting jQuery 6 <script src=" type="text/javascript"> <script src=" type="text/javascript"> <script src=" type="text/javascript"> <script src=" type="text/javascript">

jQuery philosophy jQuery selector syntax A closer look at selector syntax Some more selector examples Getting and setting attributes DOM manipulation Demonstration 2. Selection and DOM Manipulation 7

jQuery Philosophy 8

jQuery uses CSS3-style selector syntax to intelligently locate elements etc. in your page You can locate elements based on nesting, IDs, tag names, etc. Example: jQuery Selector Syntax 9 Joe Allen Nathan Dyer … Joe Allen Nathan Dyer … $(document).ready(function () { $("table#employeesTable tr:nth-child(even)").addClass("even"); }); $(document).ready(function () { $("table#employeesTable tr:nth-child(even)").addClass("even"); });

$() Short-hand for jQuery(), a powerful function for DOM queries $(document) Returns the document object on the page $(document).ready Binds a function when the DOM is ready to be manipulated $("table#employeesTable tr:nth-child(even)") Finds element whose ID is employeesTable Then finds all its child elements at even index.addClass("even") jQuery method to add a CSS class to specified DOM object A Closer Look at Selector Syntax 10 $(document).ready(function () { $("table#employeesTable tr:nth-child(even)").addClass("even"); }); $(document).ready(function () { $("table#employeesTable tr:nth-child(even)").addClass("even"); });

CSS style Hierarchy Form Some More Selector Examples 11 $("#myID") // Find by id. $(".myClass") // Find by class name. $("myTag") // Find by tag (element name). $("#id,.class, tag") // Find by multiple criteria. $("#myID") // Find by id. $(".myClass") // Find by class name. $("myTag") // Find by tag (element name). $("#id,.class, tag") // Find by multiple criteria. $("form input") // Find descendant. $("#main > *") // Find child. $("#prev ~ div") // Find sibling. $("form input") // Find descendant. $("#main > *") // Find child. $("#prev ~ div") // Find sibling. $("form :radio") // Find radio elements in forms. $("#dvMainForm :checkbox") // Find checkbox in a form. $("input:disabled") // Find disabled input elements. $("form :radio") // Find radio elements in forms. $("#dvMainForm :checkbox") // Find checkbox in a form. $("input:disabled") // Find disabled input elements.

Getting attributes: Setting attributes: Getting and Setting Attributes 12 $("em").attr("title") $("label").html() $("p:first").text() $("input").val() $("em").attr("title") $("label").html() $("p:first").text() $("input").val() $("em").attr("title", "hello") $("label").html("hello") $("p:first").text("hello") $("input").val("hello") $("em").attr("title", "hello") $("label").html("hello") $("p:first").text("hello") $("input").val("hello")

DOM Manipulation 13 $("#target").addClass("css_class"); $("#target").toggleClass("css_class"); $("p").append(" Hello "); $("span").appendTo("#foo"); $("p").after(" Hello "); $("p").before(" Hello ");

Let's take a look at a demonstration of how to use jQuery to select and manipulate DOM objects… The demo is located in the following folder: C:\JavaScriptWebDev\Demos\08-GettingStartedWithjQuery Code: Go to the HellojQuery sub-folder Open HellojQuery.sln in Visual Studio Demo instructions: See Demo_SelectionDomManipulation.docx Demonstration 14

15 Any Questions?