JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS

Slides:



Advertisements
Similar presentations
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Advertisements

CS428 Web Engineering Lecture 15 Introduction to Jquery.
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
A really fairly simple guide to: mobile browser-based application development (part 4, JQuery & DOM) Chris Greenhalgh G54UBI / Chris Greenhalgh.
Lecture 11 – DOM Scripting SFDV3011 – Advanced Web Development Reference: 1.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Jquery Nasrullah. Jquery jQuery is a JavaScript Library. jQuery greatly simplifies JavaScript programming. jQuery is easy to learn.
Introduction to the Document Object Model DOM *Understand document structure manipulation *Dynamic effects in web pages *Programming, scripting, web content.
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.
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.
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.
CO1552 – Web Application Development Further JavaScript: Part 1: The Document Object Model Part 2: Functions and Events.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
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.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Document Object Model CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also from.
Chapter 6 Murach's JavaScript and jQuery, C6© 2012, Mike Murach & Associates, Inc.Slide 1.
JQuery “write less, do more”. jQuery - Introduction Simply a JavaScript library to simplify JavaScript programming itself Wraps long standard JavaScript.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
THE DOM.
HTML Elements with JavaScript and DOM Events
Programming Web Pages with JavaScript
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Unit M Programming Web Pages with
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.
Scripting the DOM MIS 3502, Fall 2016 Jeremy Shafer Department of MIS
© 2015, Mike Murach & Associates, Inc.
jQuery – Form Validation
JQUERY Online TRAINING AT GOLOGICA
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Introduction to JavaScript
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
A second look at JavaScript
Getting started with jQuery
A (gentle???) Introduction to JavaScript
© 2015, Mike Murach & Associates, Inc.
Document Object Model (DOM): Objects and Collections
HTML5 APIs MIS3502 Jeremy Shafer Department of MIS
HTML and CSS MIS 2402 Jeremy Shafer Department of MIS
Sending a text message (and more)
Form Validation (with jQuery, HTML5, and CSS)
Form Validation, Part 2 (with jQuery, HTML5, and CSS)
Numbers, strings and dates in JavaScript
MIS JavaScript and API Workshop (Part 3)
An Introduction to Animation
MIS JavaScript and API Workshop (Part 2)
An Introduction to JavaScript
Programming Control Structures with JavaScript Part 2
Getting started with jQuery
An introduction to jQuery
JavaScript objects, functions, and events
Introduction to JavaScript
An introduction to jQuery
Introduction to MIS3502 MIS 3502 Jeremy Shafer Department of MIS
Introduction to MIS2402 MIS MIS2402 Jeremy Shafer Department of MIS
Getting started with jQuery
An introduction to jQuery
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Front End Development workshop
HTML MIS 2402 Jeremy Shafer Department of MIS Fox School of Business
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Single Page Architecture (SPA)
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:

JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS Fox School of Business Temple University

Let’s talk about… Chapter 6 What DOM short for? What’s a node? What property lets us manipulate the HTML inside a tag?

Agenda Introduce the DOM and the node interface Identify some commonly used DOM nodes Identify some commonly used node properties Use simple node properties and the click event to manipulate an HTML form Use an array to work with a collection of nodes A word of caution…

The code for a web page

All this is contained in a document node The DOM for the web page This node would contain attribute nodes of id and name All this is contained in a document node The above depicts nodes of type element and text.

Nodes and Properties The DOM nodes that are commonly used Some of the properties of the Node interface Let’s see an example of this (See dom_1.html in dom.zip)

Some Node Methods Let’s see an example of this (See dom_2.html in dom.zip)

Don’t miss this! Step 1 – Select some elements to work with Step 2 – Take some action on each element In the very near future … we’ll discover that this common 2-step task has been made easier by something called jQuery! But this is what we have for now…

innerHTML and other shortcuts If navigating to “child node” and then to “node value” to manipulate the content of a tag seems cumbersome… you’re instinct is correct! We can be thankful for maturing HTML standards for giving us shortcuts like the innerHTML property that are a little easier to work with. Let’s see an example of this (See dom_3.html in dom.zip)

More HTML DOM properties that are nice

How the DOM HTML specification can simplify your code

A word of caution It’s important to remember that the world wide web began in 1990. HTML, JavaScript and CSS have all be evolving over the past three decades. That means there are a lot of ideas that build on each other. Industry standards have been added and refined over that 30 year period. It also means that there’s always more that one way to do any task. Next class, we’ll be introducing jQuery – a JavaScript library that was created to simplify common tasks. When we do that, we’ll need to exercise some judgement about when we can use “pure” JavaScript and when we can use one of the “shortcut” methods jQuery gives us.

Let’s see what we can build …