slides courtesy of Eric Roberts

Slides:



Advertisements
Similar presentations
Imagining the Future. WORLD WIDE WEB Tim Berners-Lee invented the World Wide Web.World Wide Web A graduate of Oxford University, England, in 1989, Tim.
Advertisements

Working with Forms. how are forms manipulated? the document object contains an array of forms objects, one for each form, in document order –forms[] any.
Lesson 1 Quick HTML Know-How. A little HTML History In 1990 Tim Berners-Lee invented: World Wide Web HTML (hypertext markup language) HTTP (HyperText.
MMDE5011 – INTERACTIVE MEDIA PRACTICE 1 WEEK 1: INTRODUCTION TO HTML5
1 HTML 4.01 Student: Ling Liao Overview Introduction An example of HTML Problems of HTML Summary.
Basic HTML. HTML Background November 1990, first created by Tim Berners Lee, the father/inventor of WWW Knighted by Queen Victoria in 2004 Hypertext is.
HTML syntax By Ana Drinceanu. Definition: Syntax refers to the spelling and grammar of a programming language. Computers are inflexible machines that.
* The basic components of a web site are: * Content – information displayed or accepted from users * Static – content that doesn’t change for different.
Computer Science 101 HTML. World Wide Web Invented by Tim Berners-Lee at CERN, the European Laboratory for Particle Physics in Geneva, Switzerland (roughly.
HTML (HyperText Markup Language)
Programming the Web Web = Computer Network + Hypertext.
Fundamentals of Web Design Copyright ©2004  Department of Computer & Information Science Introducing XHTML: Module A: Web Design Basics.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction to the Internet and HTML. Objectives Students develop an understanding of the origins of the internet Students will be able to identify the.
Introduction into JavaScript Java 1 JavaScript JavaScript programs run from within an HTML document The statements that make up a program in an HTML.
XHTML1 Introduction to Web Pages N100 Building a Simple Web Page.
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Prepared by Sana Maqbool. Objectives After completing this lesson, the you will be able to… Understand about web authoring Name and explain the uses of.
4.01 How Web Pages Work.
Jerry Cain and Eric Roberts
HTML Extra Markup CS 1150 Spring 2017.
Online PD Basic HTML The Magic Of Web Pages
HTML CS 4640 Programming Languages for Web Applications
Web Basics: HTML/CSS/JavaScript What are they?
HTML5 Basics.
Creating a Web Page CSC 121.
Lecturer (Dept. of Computer Science)
Introducing XHTML: Module A: Web Design Basics
Introducing XHTML: Module A: Web Design Basics
HTML Part I.
HTML5 – Heading, Paragraph
W3C Web standards and Recommendations
Dongwon Lee, Ph.D. IST 516 Fall 2011
Lecture 8. HTML. Author: Aleksey Semyonov
XHTML 1 by Carsomyr.
Intro to Web Development Class A Review
Internet Programming.
slides courtesy of Eric Roberts
Code Expert-Web design & Development Product by: Codexoxo Source:
Introduction to JavaScript
JavaScript Introduction
CT Web Development, Colorado State University
slides courtesy of Eric Roberts
Introduction to JavaScript
Basic HTML and Embed Codes
HTML 12/27/2018.
JavaScript Programming Labs
What is HTML anyway? HTML stands for HyperText Markup Language. Developed by scientist Tim Berners-Lee in 1990, HTML is the "hidden" code that helps us.
Tutorial Developing a Basic Web Page
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
Intro to Web Development HTML Structure
Intro to Web Development Links
JavaScript and the DOM MIS 2402 Jeremy Shafer Department of MIS
Introduction to HTML5.
HTML Basics Web.
Ground to Roof HTML/HTML5
HTML What is Html? HTML stands for Hypertext Markup Language.
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
Computer communications
Introduction to World Wide Web
WEB & HTML Background Info.
Pertemuan 1 Desain web Pertemuan 1
HTML Basics Mr. Fazzalari.
HTML MIS 2402 Jeremy Shafer Department of MIS Fox School of Business
4.01 How Web Pages Work.
Introduction to JavaScript
Week 5: Recap and Portfolio Site
Web Programming and Design
HTML CS 4640 Programming Languages for Web Applications
Presentation transcript:

slides courtesy of Eric Roberts JavaScript and the Web Jerry Cain CS 106AJ November 30, 2018 slides courtesy of Eric Roberts

The History of the World Wide Web The ideas behind the web are much older than the web itself. In the early 20th century, the Belgian bibliographer Paul Otlet envisioned a universal catalogue that would provide access to all the world’s information in an interconnected structure. In 1945, the director of the wartime science program Vannevar Bush published an article entitled "As We May Think," which envisioned an electronic archive of linked information. In the early 1960s, computer visionary Ted Nelson coined the terms hyperlink and hypermedia. The modern web was developed in 1989 by Tim Berners-Lee at CERN, the European particle physics laboratory in Geneva, Switzerland. Berners-Lee developed the first version of the Hypertext Markup Language (HTML). Use of the web grew quickly after the release of Mosaic browser in 1993 and Netscape Navigator in 1994.

The Document Object Model When the browser reads a web page, it first translates the text of the web page into an internal data structure that is easier to manipulate under the control of a JavaScript program. That internal form is called the Document Object Model, or DOM. The DOM is structured into a hierarchy of data objects called elements, which usually correspond to a paired set of tags. The relationship between the HTML file and the internal representation is similar to the one between the external data file and the internal data structure in any data-driven program. The browser acts as a driver that translates the HTML into an internal form and then displays the corresponding page. Unfortunately, the DOM is poorly designed, giving rise to a structure that is difficult to understand. The best strategy is to learn only those parts of the DOM you need.

Writing Text to a <div> Element The strategy we’ll use in today’s examples uses only two features of the DOM, both of which are reasonably simple: Naming an element in the HTML file. It is often necessary to refer to a specific element in the web page from inside the JavaScript code. To do so, you need to include an id attribute in the HTML tag for that element that gives that element a name. JavaScript code can then find that element by calling document.getElementById(id). Adding HTML content to an existing element. The HTML code inside an element is available by selecting the innerHTML field of the element. The result is a JavaScript string that you can examine and modify. The code on the next slide writes the string "hello, world" into the <div> element whose id attribute is "log".

An Improved Version of HelloWorld <!DOCTYPE html> <html> <head> <title>Hello World</title> <script type="text/javascript"> function sayHello() { let div = document.getElementById("log"); div.innerHTML = "hello, world"; } </script> </head> <body onload="sayHello()"> <div id="log"> <!-- This is where the text eventually goes --> </div> </body> </html>

Simulating a Countdown <!DOCTYPE html> <html> <head> <title>Hello World</title> <script type="text/javascript"> function countdown(n) { for (let i = n; i >= 0; i--) { log(i); } function log(str) { let div = document.getElementById("log"); div.innerHTML += str + "<br/>"; </script> </head> <body onload="countdown(10)"> <div id="log"></div> </body> </html>

Exercise: Factorial Table

The End