JQuery. Is a free, open Javascript library Simplifies the task of creating highly responsive web pages Works across modern browsers Abstracts away browser-specific.

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,
SE-2840 Dr. Mark L. Hornick1 jQuery. jQuery is a library of JavaScript functions Helps minimize the amount of JavaScript you have to write in order to:
JQuery A Javascript Library Hard things made eas(ier) Norman White.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
School of Computing and Information Systems CS 371 Web Application Programming jQuery.
CS3L: Introduction to Symbolic Programming Summer 2008 Gilbert Chou Bonus Lecture: Web Programming.
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 (
JQuery CS 268. What is jQuery? From their web site:
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
JQuery March 09 th,2009 Create by
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
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),
Interacting with a Web Page using JavaScript Mat Kelly GTAI Presentation January 10, 2014.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
© 2012, Mike Murach & Associates, Inc.
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.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
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.
HTML JAVASCRIPT. CONTENTS Javascript Example NOSCRIPT Tag Advantages Summary Exercise.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
Unit 13 –JQuery Basics Instructor: Brent Presley.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
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.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
LECTURE #4: JQUERY AND FORM VALIDATION Josh Kaine Josh Kaine 4/1/2016.
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.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery.
JQuery Fundamentals Introduction Tutorial Videos
Web Basics: HTML/CSS/JavaScript What are they?
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.
CGS 3066: Web Programming and Design Spring 2017
Introduction to Web programming
JQuery.
JQUERY Online TRAINING AT GOLOGICA
Introduction to JavaScript
A second look at JavaScript
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
Web Programming Language
..
Secure Web Programming
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Document Object Model.
Computer communications
Introduction to JavaScript
Web Client Side Technologies Raneem Qaddoura
Murach's JavaScript and jQuery (3rd Ed.)
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

jQuery

Is a free, open Javascript library Simplifies the task of creating highly responsive web pages Works across modern browsers Abstracts away browser-specific features, allowing you to concentrate on design What is jQuery?

Introduction to Javascript HTML markup language content CSS presentation language presentation JavaScript scripting language behaviour JavaScriptJava

What is a scripting language? Can't communicate with OS Can't access local files Can't directly access database Can't access hardware Client-side language Works on DOM User's Computer Web Browser Web Page JavaScript Web Server Python, PHP, ASP.NET, Ruby on Rails

Document Object Model Document - Object

Document Object Model Model head html body titleh1pul li

JavaScript vs jQuery Example 1 - Hide an element with id "textbox“ //javascript document.getElementById('textbox').style.display = "none"; //jQuery $('#textbox').hide(); Example 2 - Create a tag with "my text“ //javascript var h1 = document.CreateElement("h1"); h1.innerHTML = "my text"; document.getElementsByTagName('body')[0].appendChild(h1); //jQuery $('body').append( $(" ").html("my text") ;

Enable jQuery in your page jQuery can be enabled in your page by including reference to jQuery library file <script src=" Introduce a jQuery function by using the below below given function. $(document).ready(function(){ //Script goes here }); OR $(function(){ //Script goes here });

Basic selectors TagName document.getElementsByTagName("tagName"); $("tagName") - $("div"), $("p"), $("div"),..... Tag ID document.getElementById("id"); $("#id") - $("#name"), $("#address") Tag Class document.getElementsByClassName("className"); $(".className") - $(".comment"), $(".code") To select all elements - $("*")

Selectors - Combined Syntax $("tagName.className") $("tagName.className#tagId") Examples $("h1.mainTitle") $("h1.mainTitle#firstHeading")

Index filters Syntax: $("selector:first") $("selector:last") $("selector:odd") $("selector:even") $("selector:eq(i)") $("selector:gt(i)") $("selector:lt(i)") Examples: $("p:first") $("p:last") $("p:odd") $("p:even") $("p:eq(1)") $("p:gt(1)") $("p:lt(1)")

Condition filters - Form filters $("selector:visible") $("selector:hidden") $("selector:disabled") $("selector:enabled") $("selector:checked") $("selector:selected") $("selector:header") $("selector:animated") $("selector:not(selector:not )") $("selector:input") $("selector:text") $("selector:password") $("selector:radio") $("selector:checkbox") $("selector:submit") $("selector:reset") $("selector:image") $("selector:file") $("selector:button")

Relationship filters - Content filters $("selector:parent") $("selector:first-child") $("selector:last-child") $("selector:only-child") $("selector:nth-child(i)") $("selector:nth-child(odd)") $("selector:nth- child(even)") $("selector:nth- child(Xn+M)") $("selector:content('text') ") $("selector:empty") $("selector:has(selector)")

Attribute filters Syntax: $("selector[attribute]") $("selector[attribute=value ]") $("selector[attribute!=value ]") $("selector[attribute^=valu e]") $("selector[attribute$=valu e]") $("selector[attribute*=valu e]") Examples: $("p:[name]") $("p:[name=para]") $("p:[name!=para]") $("p:[name^=para]") $("p:[name$=para]") $("p:[name*=para]")

Retrieve, Set and Remove attributes Syntax: $("selector").attr("name") $("selector").attr("key", "val") $("selector").attr("key", fn() ) $("selector").attr(propertie s) $("selector").removeAttr(a ttr) Examples: $("img").attr("src") $("p").attr("class", "source") $("img").attr("height", calHt()) $("img").attr({ "src" : "/path/", "title" : "My Img" }); $("div").removeAttr("class“ )

Class, HTML, Text, Value - Functions $("selector").hasClass("className") $("selector").addClass("className") $("selector").removeClass("className") $("selector").toggleClass("className") $("selector").html() $("selector").html("html code") $("selector").text() $("selector").text("text content") $("selector").val() $("selector").val("value")

Traversing Syntax: $("selector").length $("selector").size() $("selector").get() $("selector").get(index) $("selector").find("selector") $("selector").each(function(){ $(this).xxxx(); }); Examples: $("h1").length $("h1").size() var h1_list = $("h1").get() var h1 = $("h1").get(2) $("select").find(" option[value='india']") $("selector").each(function(){ $(this).addClass('title'); });

Events bind() unbind() ready() toggle() hover() trigger() $("selector").bind(event, data, handler) $("selector").unbind(event, handler)

Bind - Example $(function(){ $("#myButton").bind("onclick", validate); $("#myButton").click( validate); }); function validate(){ if( $("#myText").val().length == 0 ) { alert("Error") } else { $("#myForm").submit(); }}}}

Animations show() hide() fadeIn() fadeOut() slideUp() slideDown()

Additional Features jQuery UI AJAX functionality

Thank you