A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / 2011-03-03 1Chris Greenhalgh.

Slides:



Advertisements
Similar presentations
JQuery CS 380: Web Programming. What is jQuery? jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling,
Advertisements

A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
1 Lesson 10 Using JavaScript with Styles HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
JavaScript & jQuery the missing manual Chapter 11
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
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),
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.
Review IDIA 619 Spring 2013 Bridget M. Blodgett. HTML A basic HTML document looks like this: Sample page Sample page This is a simple sample. HTML user.
CITS1231 Web Technologies JavaScript and Document Object Model.
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.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
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.
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 10.
A really fairly simple guide to: mobile browser-based application development (part 2, CSS) Chris Greenhalgh G54UBI / Chris Greenhalgh
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.
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.
TOPIC II Dynamic HTML Prepared by: Nimcan Cabd Cali.
HTML JAVASCRIPT. CONTENTS Javascript Example NOSCRIPT Tag Advantages Summary Exercise.
Welcome to jQuery jQuery is one of many available libraries that – Provide functions for manipulating the web page With fairly good performance – Help.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
IS2802 Introduction to Multimedia Applications for Business Lecture 07: Introduction to jQuery Rob Gleasure
Unit 13 –JQuery Basics Instructor: Brent Presley.
INTRODUCTION TO HTML5 New HTML5 User Interface and Attributes.
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.
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.
Positioning Objects with CSS and Tables
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
The Web Wizard’s Guide To DHTML and CSS Chapter 2 A Review of CSS2 and JavaScript.
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.
Chapter 10 Dynamic HTML (DHTML) JavaScript, Third Edition.
XML DOM Week 11 Web site:
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
Shaun Geisert Matt Trice. What is jQuery?  Open source Javascript library/framework Created by John Resig  Their tagline – “The Write Less, Do More.
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
Web Basics: HTML/CSS/JavaScript What are they?
Programming Web Pages with JavaScript
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.
Human Computer Interaction
Concepts of HTML, CSS and Javascript
Intro to JavaScript CS 1150 Spring 2017.
CGS 3066: Web Programming and Design Spring 2017
JQuery Basics 소속 / 작성자 이 문서는 나눔글꼴로 작성되었습니다. 설치하기.
JQuery.
JQUERY Online TRAINING AT GOLOGICA
Application with Cross-Platform GUI
Week 11 Web site: XML DOM Week 11 Web site:
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
..
JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS
Javascript and JQuery SRM DSC.
Document Object Model.
Chengyu Sun California State University, Los Angeles
Murach's JavaScript and jQuery (3rd Ed.)
© 2017, Mike Murach & Associates, Inc.
JavaScript and the DOM MIS 2402 Maxwell Furman Department of MIS
Presentation transcript:

A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh

Contents DOM concepts JQuery – Selectors – Some common operations 2Chris Greenhalgh

HTML describes a tree of elements Some 10-point text, Bold p style“font-size: 10” Attributes: “Some 10-point text,” b “Bold” 3Chris Greenhalgh

The Document Object Model The DOM is an API onto the browser’s internal tree model of the web page – Allows Javascript in a web page to manipulate the page itself Add, delete and move “nodes”, i.e. elements and text Change attributes, including CSS styling – Exposed through the “document” object The API is quite verbose and not completely consistent in different browsers 4Chris Greenhalgh

JQuery JQuery is a Javascript library or framework which makes it easier to write dynamic web pages – (There are lots of others, too) JQuery includes support for (amongst other things): – DOM and CSS manipulation – Network operations (AJAX) 5Chris Greenhalgh

Setting up JQuery Before you can use JQuery (or an Javascript library) you must include it in your page… – Copy the javascript library, e.g. jquery min.js – Add a script element to the HTML file header before any other scripts which depend on JQuery: 6Chris Greenhalgh

Ready? Browsers are inconsistent in when Javascript runs and when the DOM is available So JQuery provides a way to run code as soon as the DOM is ready: $(document).ready( function() { alert(‘ready!’); } ); – i.e. “when the document is read, run the code for the given function” This is an anonymous (unnamed) function – just a wrapper for its statements 7Chris Greenhalgh

JQuery code structure Most Jquery commands look something like this: $ ('#maindiv'). show('fast'); Global function Element selector Operation(s) (methods) Produces a list of elements to be operated on 8Chris Greenhalgh

JQuery Selectors As with CSS, by – element (tag) name E.g. “p” – ID attribute E.g. “#Alice” – class attribute E.g. “.sans” And in a lot more ways – See JQuery “selectors” A paragraph. Another paragraph. Paragraph with class sans Another paragraph with class sans Paragraph with class sans and id Alice. 9Chris Greenhalgh

JQuery operations Show/hide an element (animation) –.show(‘fast'),.hide () Get/set an attribute –.attr('value'),.attr('value','14'); Get/set the HTML content of an element –.html(),.html(' Stuff… '); Get/set a CSS style property value –.css('width'),.attr('width','100px'); Change CSS class –.addClass('boldc'),.removeClass('boldc'); Lots more – See JQuery API documentation Chris Greenhalgh

Summary You should now be able to – Include JQuery in your browser app – Use JQuery to dynamically change the content and appearance of your application page Showing and hiding elements Changing content Changing CSS styling 11Chris Greenhalgh