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.

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,
JQuery A Javascript Library Hard things made eas(ier) Norman White.
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.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Anatomy of an App HTML, CSS, jQuery, jQuery Mobile CIS 136 Building Mobile Apps 1.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
JQuery CS 268. What is jQuery? From their web site:
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’
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.
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.
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.
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
JQuery and AJAX WEB Technologies : PHP Programming Language.
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 Programming JAvaScript Ajax Programming Web Programming /38.
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.
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.
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.
LECTURE #4: JQUERY AND FORM VALIDATION Josh Kaine Josh Kaine 4/1/2016.
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)
Engr. Md. Nazim Uddin M.Sc. Eng. (CSE), B.Sc. Engg. (CSE), MIEB Cell: Website:
SharePoint & jQuery. About me Phill Duffy – Product Manager at Lightning Tools Ltd – Author of ‘Pro SharePoint with jQuery’ – MCTS Application Developer.
JQuery is a fast, small, and feature-rich javascript library. It makes things like HTML document traversal and manipulation, event handling, animation,
JQuery Fundamentals Introduction Tutorial Videos
What is jQuery?.
Introduction to Web programming
-By Yogita Nirmal.
Tek Raj Chhetri Code for Humans not for machine.
Human Computer Interaction
Intro to jQuery jQuery is a popular, and extensible, JavaScript library Supports … DOM manipulation CSS manipulation HTML event methods Effects & animations.
Introduction to Web programming
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
JQuery.
JQUERY Online TRAINING AT GOLOGICA
The Cliff Notes Version
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
..
Javascript and JQuery SRM DSC.
E-commerce Applications Development
Document Object Model.
Web Programming Language
Introduction to jQuery
SEEM4540 Tutorial 3 jQuery Wong Wai Chung.
JQuery.
Presentation transcript:

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 also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

What jQuery Does The jQuery library contains the following features: HTML/DOM manipulation CSS manipulation HTML event methods AJAX Effects and animations

Adding jQuery to Your Website Downloading jQuery Library to your computer From jQery.com The jQuery library is a single JavaScript file, and you reference it with the HTML tag for example:

Another Method If you don't want to download and host jQuery yourself, you can include it from a CDN (Content Delivery Network). For example: getting jQuery Library from Google,

jQuery Syntax The jQuery syntax is tailor made for selecting HTML elements and performing some action on the element(s). Basic syntax is: $(selector).action() $ sign to define/access jQuery (selector) to “find" HTML elements jQuery action() to be performed on the element(s)

Examples $("p").hide() - hides all elements. $(".test").hide() - hides all elements with class="test". $("#test").hide() - hides the element with id="test". Basically, you can use CSS style selector to find a particular element in your HTML document.

Document.ready() function document.ready() is a function from jQeury. $(document).ready(function(){ //your own jQeury code. }); This is to prevent any jQuery code from running before the document is finished loading.

jQuery Selectors jQuery selectors are used to find HTML elements based on their id, classes, types, attributes, etc. All selectors in jQuery start with the dollar sign and parentheses: $(). For example: $(“p”), $(“.conclusion”), $(“#creditCard”) This will find all of elements in the HTML document.

jQuery Event Handling In jQuery, most DOM events have an equivalent jQuery method. To assign a click event to all paragraphs on a page, $("p").click(); Next, define how to react if the event happens: $("p").click(function(){ $(this).hide(); });

Examples $("input").focus(function(){ $(this).css("background-color","#cccccc"); }); $("#p1").hover(function(){ alert("You entered p1!"); }, function(){ alert("Bye! You now leave p1!"); });

JQuery: get() function Three simple jQuery methods for DOM manipulation are: text() - Sets or returns the text content of selected elements html() - Sets or returns the content of selected elements (including HTML markup) val() - Sets or returns the value of form fields

Examples of getting contents $("#btn1").click(function(){ alert("Text: " + $("#test").text()); }); $("#btn2").click(function(){ alert("HTML: " + $("#test").html()); }); $("#btn3").click(function(){ alert("Value: " + $("#firstname").val()); });

Getting Attributes attr() method is used to get attribute values. For example: $("button").click(function(){ alert($("#linkGoogle").attr("href")); alert($(“#mainContent”).attr(“style”); });

JQuery: set() function We will use the same three methods to set content: text() - Sets or returns the text content of selected elements html() - Sets or returns the content of selected elements (including HTML markup) val() - Sets or returns the value of form fields

Examples of setting contents $("#btn1").click(function(){ $("#test1").text("Hello world!"); }); $("#btn2").click(function(){ $("#test2").html(" Hello world! "); }); $("#btn3").click(function(){ $("#test3").val(“Hello World"); });.

Examples of setting contents $("#btn1").click(function(){ $("#test1").text("Hello world!"); }); $("#btn2").click(function(){ $("#test2").html(" Hello world! "); }); $("#btn3").click(function(){ $("#test3").val(“Hello World"); });.

Examples of setting contents $("#btn1").click(function(){ $("#test1").text("Hello world!"); }); $("#btn2").click(function(){ $("#test2").html(" Hello world! "); }); $("#btn3").click(function(){ $("#test3").val(“Hello World"); });.

Example of setting attributes attr() - is used to set/change attribute value(s). For example: $("button").click(function(){ $("#mainContent").attr({ “style" : “background-color: yellow", “font-size” : “20pt" }); });

jQuery: Add Elements We will look at four jQuery methods that are used to add new content: append() - Inserts content at the end of the selected elements prepend() - Inserts content at the beginning of the selected elements after() - Inserts content after the selected elements before() - Inserts content before the selected elements

Examples Append() - inserts content at the END of the selected HTML elements. $("p").append("Some appended text."); prepend() - inserts content at the BEGINNING of the selected HTML elements. $("p").prepend("Some prepended text."); after() - inserts content AFTER the selected HTML elements. $(“firstname”).after(“Guanyu”);

Remove Elements To remove elements and content, there are mainly two jQuery methods: remove() - Removes the selected element (and its child elements) empty() - Removes the child elements from the selected element

Examples remove() - removes the selected element(s) and its child elements $("#div1").remove(); The jQuery empty() method removes the child elements of the selected element(s). $("#div1").empty(); remove() method also accepts one parameter, which allows you to filter the elements to be removed. $("p").remove(“#mainContent");