Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help.

Slides:



Advertisements
Similar presentations
JavaScript – Quiz #8 Lecture Code:
Advertisements

JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
Week 12: JQuery Write less, do more.. JQuery Basics Lightweight JavaScript Library – Emphasizes interaction between JavaScript and HTML – Reduces technical.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
JQuery. What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Basics of HTML. Example Code Hello World Hello World This is a web page.
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:
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
Sascha Wener.  Definition from Microsoft Developer Network: “A theme is a unified set of design elements and color schemes that you apply to pages to.
Creating Web Pages Overview. Design – Start with a Purpose Before you start any web page, you need to design the website. The first question that should.
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),
Hard to Reach HTML Mike Hanson AO, OES Web Workgroup Conference Chicago 10/27/2010.
Interacting with a Web Page using JavaScript Mat Kelly GTAI Presentation January 10, 2014.
HTML CRASH COURSE. What is HTML?  Hyper Text Markup Language  The language used to make web pages  Written by using tags.
CITS1231 Web Technologies JavaScript and Document Object Model.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
© 2012, Mike Murach & Associates, Inc.
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.
Videos. Adding Videos to a Web Page Videos can make our pages more interesting and engaging. Most video-hosting services, such as YouTube, will provide.
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.
1 Javascript DOM Peter Atkinson. 2 Objectives Understand the nature and structure of the DOM Add and remove content from the page Access and change element.
Advanced DOM Builds on last presentation on DOM Allows you to dynamically create elements and position them on a page DOM methods/properties are W3C standard.
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.
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
Unit 13 –JQuery Basics Instructor: Brent Presley.
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Web Technologies Lecture 8 JQuery. “A fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax.
Basic HTML swap with AJAX. Lets get our beloved html for our llama site. Open the index.html page and add a class to our navigation links. Then lets add.
Cascading Style Sheets (CSS) EXPLORING COMPUTER SCIENCE – LESSON 3-5.
JS: Document Object Model (DOM) DOM stands for Document Object Model, and allows programmers generic access to: DOM stands for Document Object Model, and.
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 1 Murach's JavaScript and jQuery, C1© 2012, Mike Murach & Associates, Inc.Slide 1.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Introduction to JavaScript LIS390W1A Web Technologies and Techniques 24 Oct M. Cameron Jones.
JQUERY AND AJAX
LECTURE #4: JQUERY AND FORM VALIDATION Josh Kaine Josh Kaine 4/1/2016.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Net-centric Computing Document Object Model (DOM).
Java Script and the DOM DOM stands for: –The Document Object Model When a browser reads a web page, it converts it’s contents from HTML into a hierarchical.
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 Fundamentals Introduction Tutorial Videos
Introduction to.
HTML Elements with JavaScript and DOM Events
Tek Raj Chhetri Code for Humans not for machine.
14 A Brief Look at JavaScript and jQuery.
Introduction to JavaScript
JavaScript Introduction
A second look at JavaScript
JQuery with ASP.NET.
The Web Wizard’s Guide To JavaScript
Introduction to JavaScript
[Robert W. Sebesta, “Programming the World Wide Web
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
JavaScript and the DOM MIS 2402 Maxwell Furman Department of MIS
Presentation transcript:

Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help to keep your JS code clean Indirectly help to protect security (somewhat) Those are the benefits of using such a library The downside is that you have an extra dependency and need to learn a new library

Getting started with jQuery  Download a copy of the jquery JS file and store it on your hard drive  Reference the JS file in your HTML  Access the jQuery functions via the $ object

Simple example function doit() { $("#stuff").text($("#inpt").val()); } Rewriting the contents of a span. No security problems or cross-browser compatibility problems.

Warning: You need clean HTML  If you want jQuery to perform reliably…  Always include tag  Always put this line before your tag  This tells the browser to operate in "standards" mode.  Always include "" around your attribute values blah blah

Examples of things you can do with jQuery Read the contents of DOM nodes (tag) Modify the contents of DOM nodes Modify the appearance of DOM nodes Create and attach new DOM nodes Remove DOM nodes Run a function right when the page is ready Add and remove event handlers Retrieve content from a web server Send content to a web server

Example: Modifying DOM appearance.nice {background-color: orange; color: white;} Click me! function toggle() { var els = $("#clickme"); if (!els.hasClass('nice')) els.addClass('nice'); else els.removeClass('nice'); }

Example: Creating new nodes Add stuff function addstuff() { for (var i = 0; i < 10; i++) { $('#mydiv').append(' '+i+' '); }

Example: Removing nodes Add stuff function addstuff() { var kids = $(".kid"); // this creates a "wrapped set" around all nodes with class=kid if (!kids.length) { for (var i = 0; i < 10; i++) $('#mydiv').append(' '+i+' '); } else { kids.remove(); }

Example: Running code on page ready Add stuff function addstuff() { var kids = $(".kid"); if (!kids.length) { for (var i = 0; i < 10; i++) $('#mydiv').append(' '+i+' '); } else { kids.remove(); } $(addstuff);

Example: Manipulating event handlers.nice {background-color: orange; color: white;} Click me! function toggle() { var els = $("#clickme"); if (!els.hasClass('nice')) els.addClass('nice'); else els.removeClass('nice'); } $("#clickme").click(toggle);