D2L Notes Be sure to submit your link in the dropbox provided on D2L You can just upload an empty text file if a file upload is required Do not use D2L.

Slides:



Advertisements
Similar presentations
The Document Object Model
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
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.
JavaScript and AJAX Jonathan Foss University of Warwick
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
The Document Object Model (DOM) 1 JavaScript is an object-based language—that is, it’s based on manipulating objects by changing each object’s properties.
A really fairly simple guide to: mobile browser-based application development (part 1) Chris Greenhalgh G54UBI / Chris Greenhalgh
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Lesson 12- Unit L Programming Web Pages with JavaScript.
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
1 Lesson 10 Using JavaScript with Styles HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
JS: Document Object Model (DOM)
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript & DOM Client-side scripting. JavaScript JavaScript is a tool to automate client side (which is implemented using HTML so far) JavaSript syntax.
DOM and JavaScript Aryo Pinandito.
Lecture 11 – DOM Scripting SFDV3011 – Advanced Web Development Reference: 1.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
5.2 DOM (Document Object Model). 2 Motto: To write it, it took three months; to conceive it three minutes; to collect the data in it — all my life. —F.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
JavaScript IV ECT 270 Robin Burke. Outline DOM JS document model review W3C DOM.
Introduction to JavaScript CS101 Introduction to Computing.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
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.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
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.
Document Object Model. Back to the DOM… Javascript and the DOM  Originally, the Document Object Model (DOM) and Javascript were tightly bound  Each.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
School of Computing and Information Systems CS 371 Web Application Programming JavaScript - DOM Modifying the Page from within.
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.
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.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
HTML DOM Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Session: 4. © Aptech Ltd. 2Creating Hyperlinks and Anchors / Session 4  Describe hyperlinks  Explain absolute and relative paths  Explain how to hyperlink.
JS: Document Object Model (DOM) DOM stands for Document Object Model, and allows programmers generic access to: DOM stands for Document Object Model, and.
This is our seminar JavaScript And DOM This is our seminar JavaScript And DOM.
Introduction to JavaScript LIS390W1A Web Technologies and Techniques 24 Oct M. Cameron Jones.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
THE DOM.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Unit M Programming Web Pages with
CHAPTER 5 DOCUMENT OBJECT MODEL
Scripting the DOM MIS 3502, Fall 2016 Jeremy Shafer Department of MIS
Unit M Programming Web Pages with
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Document Object Model (DOM): Objects and Collections
JavaScript Introduction
Mr. Justin “JET” Turner CSCI 3000 – Fall 2016 Section DA MW 4:05-5:20
Introduction to Web programming
Presentation transcript:

D2L Notes Be sure to submit your link in the dropbox provided on D2L You can just upload an empty text file if a file upload is required Do not use D2L messaging to get in touch with me, send me an Discussion areas are open for use for anything relevant to the course subjects

Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45

JavaScript JavaScript (JS) is our client side programming language This means that the code is executed by the user’s browser and not by the server providing the page It is important to understand this concept, because a user could potentially change settings in their browser to not render JS at all, or use tools to modify what it is supposed to do on a single page load For this reason, when building larger sites, we often need to consider how the site would render without JS

JavaScript Again, for this course, we are assuming internal customers who have the correct browser settings When we get into PHP and MySQL later on, we will be working with forms and validating input data We can use JS to do some client side validation, but we should never leave that as the only type of validation JS excels at performing tasks such as modifying HTML content, attributes, and CSS

JavaScript JS can go in the or wrapped in tags, as well as in an external file (.js) We might put some JS in an external file that takes care of making our menu’s function, and then put some JS in the page to manage how a unique element works on that page (example: directory table sorting) Some JS also goes in tags as part of attributes, such as:

JavaScript Basic JS syntax variables data types arrays functions/methods variable scope conditionals loops Date Basic object manipulation

JavaScript Modify contents of an HTML tag document.getElementById(“divID”).innerHTML = “”; Modify attributes of an HTML tag document.getElementById(“myImg”).src = “”; Modify styles of an HTML tag document.getElementById(“divID”).style.fontSize = “”;

JavaScript DOM DOM = Document Object Model This is the hierarchy of objects on the page and how we access the items using JS Document Node HTML Element Node HTML Attribute Node

JavaScript Document addEventListener() anchors tags with names baseURI full page URL body createElement() getElementById() getElementsByClassName() getElementsByName() getElementsByTagName() write() getElements* returns an array of elements, even if only one item returned

JavaScript Element addEventListener() appendChild() attributes childElementCount childNodes includes text/comments children excludes text/comments className cloneNode() firstChild firstElementChild lastChild lastElementChild nextSibling nextSiblingElement parentNode parentElement

JavaScript Element getAttribute() value getAttributeNode() hasAttribute() hasAttributes() getElementsByClassName() getElementsByTagName() hasChildNodes() click() focus() id innerHTML style textContent

JavaScript Attribute name value specified

Next Time We will look at JS events Take a little time and think about examples you all may want to see me do in class. There is a new discussion section where you can post these ideas, and I will see about adding them into the correct section of the course or post an example on the discussion if we don’t get to it in class Some examples might be a slideshow or a menu