Page Load © Copyright 2014, Fred McClurg All Rights Reserved.

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Source: ojects/tabber/ ojects/tabber/
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.
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
The Web Warrior Guide to Web Design Technologies
 CSS ids  Pages  Sites  HTML: class=“name”  Names may define format OR content › Either works  CAN apply multiple classes to the same tag  Multiple.
JQuery CS 268. What is jQuery? From their web site:
CNIT 133 Interactive Web Pags – JavaScript and AJAX Event and Event Handling.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
© 2008 RightNow Technologies, Inc. Dynamic Forms in Customer Portal Overview.
© 2007 Fred Ryals Conditional Content – A Dynamic HTML Demonstration Fred Ryals Senior Web Developer Leading Edge Design & Systems.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
HTML B OOT C AMP Itinerary Kirkwood Continuing Education © Copyright 2015, Fred R. McClurg All Rights Reserved.
Unobtrusive JavaScript
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
1 Introduction to Javascript Peter Atkinson. 2 Objectives To understand and use appropriately some of the basic elements of Javascript: –alert and prompt.
Interacting with a Web Page using JavaScript Mat Kelly GTAI Presentation January 10, 2014.
Banners - HTML A banner is a zip-package containing a HTML file, CSS file, and optionally JavaScript file and assets in a asset directory. The banner is.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
More Events and Validation CS Page/window events CS380 2.
HTML B OOT C AMP Chapter 11 Frames Kirkwood Continuing Education © Copyright 2015, Fred McClurg All Rights Reserved.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
HTML.
Dialog boxes in JavaScript Events in JavaScript – What are they – “Which events are there?” – “How do I register event handlers to an HTML element?” –
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.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 4 Dynamic HTML & CSS.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
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.
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
JavaScript Functions A function is a block of code that can be reused. It is similar to a method in Java. It consists of a function name, an argument.
USING JAVASCRIPT TO SHOW AN ALERT Web Design Sec 6-2 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
Comments Introduction to JavaScript © Copyright 2016, Fred McClurg All Rights Reserved.
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
Chapter 13: DHTML: Object Model and Collections CIS 275—Web Application Development for Business I.
COM621: Advanced Interactive Web Development Lecture 6 – JavaScript (cont.)
SE-2840 Dr. Mark L. Hornick 1 Dynamic HTML Handling events from DOM objects.
REEM ALMOTIRI Information Technology Department Majmaah University.
JAVA SCRIPT HOW TO PROGRAM DR. JOHN ABRAHAM PROFESSOR UTPA SOME SLIDES FROM W3SCHOOLS.
Week-12 (Lecture-1) Cascading Style Sheets (CSS): describe how documents are presented on screens. Types of Style Sheets: External Style Sheet - Define.
JQuery Fundamentals Introduction Tutorial Videos
CSS Colors, JavaScript Variables, Conditionals and Basic Methods
Build in Objects In JavaScript, almost "everything" is an object.
Week 3: Introduction to Javascript
Using JavaScript to Show an Alert
JavaScript: Good Practices
Week 4: Introduction to Javascript
JavaScript.
Intro to JavaScript CS 1150 Spring 2017.
DHTML Javascript Internet Technology.
A (gentle???) Introduction to JavaScript
JavaScript: How To? B. Ramamurthy.
DHTML Javascript Internet Technology.
Unit 6 part 3 Test Javascript Test.
Javascript.
JavaScript Basics Topics Review Important Methods Writing Functions
Web-Applications & AJAX
HTML and CSS Basics.
Week 5: Recap and Portfolio Site
Web Programming and Design
Introduction to Web programming
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Page Load © Copyright 2014, Fred McClurg All Rights Reserved

Loading a Page Discussion: It is often preferred to wait until the entire page is loaded before executing a script. The onload() event does not fire until the page has completed loading. 2

Event onload() via body Attribute Discussion: The “onload()” event can be defined as an attribute to the body element. Example: Event onload() via body Attribute function waitUntilLoaded() { alert( 'Page load complete' ); } 3 onloadViaBodyAttrib.html

Page onload() via window event Discussion: The “onload()” method can also be defined as an event to the window element. Example: Page onload() via window event function waitUntilLoaded() { alert( 'Page load complete' ); } window.onload = function() { waitUntilLoaded(); } 4 onloadViaWinEvent.html

Show/Hide Page Elements (HTML) HTML Example Code: Show/Hide Page Elements "I never met a bitter person who was thankful. Or a thankful person who was bitter." -- Nick Vujicic Australian motivational speaker born with a rare disorder characterized by the absence of all four limbs styleDisplayShowHide.html

Show/Hide Page Elements (JS) JavaScript Example Code: // show and hide biography function initializeBio() { document.getElementById("author").onclick = function() { var bioObj = document.getElementById("bio"); if ( document.getElementById("bio").style.display == "block" ) { // set CSS to hide the DIV document.getElementById("bio").style.display = "none"; } else { // set CSS to show the DIV document.getElementById("bio").style.display = "block"; } }; // now hide it on the initial page load. document.getElementById("bio").style.display = "none"; } window.onload = function() { initializeBio(); }; 6 styleDisplayShowHide.html