COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

Similar documents
COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

Web Site Development with HTML/JavaScrip

Creating A Web Page. Computer Concepts I and II. Sue Norris

E-Applications. XML and DOM in Javascript. Michail Lampis

Programmazione Web a.a. 2017/2018 HTML5

Understanding this structure is pretty straightforward, but nonetheless crucial to working with HTML, CSS, and JavaScript.

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

introduction to XHTML

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

HTML and CSS COURSE SYLLABUS

INLEDANDE WEBBPROGRAMMERING MED JAVASCRIPT INTRODUCTION TO WEB PROGRAMING USING JAVASCRIPT

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Motivation (WWW) Markup Languages (defined). 7/15/2012. CISC1600-SummerII2012-Raphael-lec2 1. Agenda

Document Object Model. Overview

Web Development and HTML. Shan-Hung Wu CS, NTHU

CSC309 Tutorial CSS & XHTML

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Final Exam Study Guide

XHTML. XHTML stands for EXtensible HyperText Markup Language. XHTML is the next generation of HTML. XHTML is almost identical to HTML 4.

Student, Perfect Midterm Exam March 24, 2006 Exam ID: 3193 CS-081/Vickery Page 1 of 5

Module 2 (III): XHTML

This document provides a concise, introductory lesson in HTML formatting.

c122jan2714.notebook January 27, 2014

HTML CS 4640 Programming Languages for Web Applications

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Web development using PHP & MySQL with HTML5, CSS, JavaScript

singly and doubly linked lists, one- and two-ended arrays, and circular arrays.

A Brief Introduction to a web browser's HTML. and the Document Object Model (DOM) Lecture 28

A network is a group of two or more computers that are connected to share resources and information.

11 TREES DATA STRUCTURES AND ALGORITHMS IMPLEMENTATION & APPLICATIONS IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

First Name Last Name CS-081 March 23, 2010 Midterm Exam

11. HTML5 and Future Web Application

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

HTML, XHTML, and CSS. Sixth Edition. Chapter 1. Introduction to HTML, XHTML, and

Html basics Course Outline

GRAPHIC WEB DESIGNER PROGRAM

Hyper Text Markup Language HTML: A Tutorial

HTML. Mendel Rosenblum. CS142 Lecture Notes - HTML

Proper_Name Final Exam December 21, 2005 CS-081/Vickery Page 1 of 4

1.264 Lecture 12. HTML Introduction to FrontPage

Time: 3 hours. Full Marks: 70. The figures in the margin indicate full marks. Answer from all the Groups as directed. Group A.

INTERNET & WEB APPLICATION DEVELOPMENT SWE 444. Fall Semester (081) Module 4 (VII): XML DOM

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

Index. CSS directive, # (octothorpe), intrapage links, 26

INTRODUCTION TO WEB USING HTML What is HTML?

Revision for Grade 7 ASP in Unit :1&2 Design & Technology Subject

Advanced Web Programming C2. Basic Web Technologies

Announcements. Paper due this Wednesday

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

HTML Overview formerly a Quick Review

HyperText Markup Language (HTML)

XHTML & CSS CASCADING STYLE SHEETS

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Bridges To Computing

Index LICENSED PRODUCT NOT FOR RESALE

What is XHTML? XHTML is the language used to create and organize a web page:

HTML Syllabus Instructor: TBD

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

INTRODUCTION TO HTML5! HTML5 Page Structure!

MPT Web Design. Week 1: Introduction to HTML and Web Design

Mobile MOUSe WEB SITE DESIGN ONLINE COURSE OUTLINE

Understanding the Web Design Environment. Principles of Web Design, Third Edition

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Mobile Site Development

CSS: Cascading Style Sheets

Trees. Carlos Moreno uwaterloo.ca EIT

Website Development with HTML5, CSS and Bootstrap

Markup Language. Made up of elements Elements create a document tree

Static Webpage Development

CSC 121 Computers and Scientific Thinking

HTML: The Basics & Block Elements

1. Setup a root folder for the website 2. Create a wireframe 3. Add content 4. Create hyperlinks between pages and to external websites

Certified HTML5 Developer VS-1029

HTMLnotesS15.notebook. January 25, 2015

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

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

JavaScript 3. Working with the Document Object Model (DOM) and DHTML

Lesson 5 Introduction to Cascading Style Sheets

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Tizen Web UI Technologies (Tizen Ver. 2.3)

Brief Intro to HTML. CITS3403 Agile Web Development. 2018, Semester 1

Introduction to Web Technologies

Exam : 9A Title : Adobe GoLive CS2 ACE Exam. Version : DEMO

Web Design and Application Development

Introduction to the Internet and World Wide Web p. 1 The Evolution of the Internet p. 2 The Internet, Intranets, and Extranets p. 3 The Evolution of

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

Shankersinh Vaghela Bapu Institue of Technology

5/19/2015. Objectives. JavaScript, Sixth Edition. Understanding the Browser Object Model and the Document Object Model. Objectives (cont'd.

Transcription:

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1

LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings, images, colors, tables, forms, etc. XHTML difference with HTML DHTML What is it? Why is it needed Javascript Overview, what is it, why is it needed, etc. How does it fit with HTML CS3101: Scripting Languages: Javascript Ramana Isukapalli 2

PREREQUISITES A good background in at least one programming language is recommended. Ability to learn quickly. CS3101: Scripting Languages: Javascript Ramana Isukapalli 3

OVERVIEW OF HTML HTTP: Communication protocol between Any web server (e.g., www.cnn.com) and Browswer (e.g., firefox, IE, Opera, etc.) HTML Hyper-Text Markup Language Format in which web data is stored. Web Browser HTTP Web Server CS3101: Scripting Languages: Javascript Ramana Isukapalli 4

HTML CONTD. Format in which a web server stores the content. Transferred over to the client (using HTTP). Hypertext stores data of many formats Simple text with different fonts, sizes, colors, paragraphs, etc. Audio, video, image files, etc. Uses markup tags, e.g., <h1> Heading </h1> Can arrange data in tables, bullets, web links, forms, etc. HTML details HTML details http://www.w3schools.com/html/default.asp http://www.w3.org/tr/html4/ CS3101: Scripting Languages: Javascript Ramana Isukapalli 5

A TYPICAL HTML PAGE <html> <!-- Beginning of the HTML page --> <head> <!--Typically has page title, useful for search engines --> <title> My Web page </title> <-- Page title --> </head> <body> <-- Body of the web page, has main content--> Content </body> </html> <-- End of the HTML page --> CS3101: Scripting Languages: Javascript Ramana Isukapalli 6

HTML TAGS Headings <h1>, <h2>, <h3> Anchor <a> Table <table> Table row <tr> Table cell <td> No support for scripts <noscript> Form <form> Image <img> Lists <li> Ordered list <ol> Unordered list -- <ul> No support for frames <noframes> n n These tags are used to format a web page content A complete list of tags can be found at http://w3schools.com/tags/default.asp CS3101: Scripting Languages: Javascript Ramana Isukapalli 7

XHTML XHTML EXtensible HyperText Markup Language Combines HTML with strict syntax of XML Almost identical to HTML XHTML is a stricter and cleaner version of HTML. XHTML is HTML defined as an XML application. XHTML consists of DOCTYPE declaration head body CS3101: Scripting Languages: Javascript Ramana Isukapalli 8

XHTML RULES XHTML elements must be Properly nested e.g., <head> <title>. </title> </head> Always closed e.g., <body>.. </body> In lowercase XHTML documents must have one root element XHTML Attribute names must be in lower case E.g., <table WIDTH= 100% > is wrong. Attribute values must be quoted e.g., <table width= 100% > Attribute minimization is forbidden <input checked="checked" /> instead of <input checked> CS3101: Scripting Languages: Javascript Ramana Isukapalli 9

ANOTHER HTML EXAMPLE <html> <head> <title>dom Tutorial </title> </head> <body> <h1>dom Lesson one </h1> <p> Hello world! </p> </body> </html> <html> node is the root node Has no parent node Parent node of the <head> and <body> nodes is the <html> node. Parent node of the "Hello world!" text node is the <p> node <html> node has two child nodes <head> and <body> <head> node has one child node <title> node <title> node has one child node text node "DOM Tutorial" <h1> and <p> nodes are siblings Both child nodes of <body> 10

HTML TREE STRUCTURE Follow the standard tree nomenclature Top node is called the root Every node, except the root, has exactly one parent node. Root has none. A node can have any number of children Leaf is a node with no children Siblings are nodes with the same parent 11

ACCESSING HTML NODES getelementbyid (<id>) getelementsbytagname(<tag>) A combination of the above Using the tree and parent/child relationship. 12

HTML PROPERTIES For any HTML element (node) x, x.innerhtml - the inner text value of x x.nodename - the name of x x.nodevalue - the value of x x.parentnode - the parent node of x x.childnodes - the child nodes of x x.attributes - the attributes nodes of x 13

BACK TO THE EXAMPLE document - the current HTML document getelementbyid("intro") - the element with the id "intro" childnodes[0] - the first child of the element nodevalue - the value of the node (e.g., text) 14

HTML METHODS For any HTML element (node) x x.getelementbyid(id) get the element with a specified id x.getelementsbytagname (name) get all elements with a specified tag name. Tag = body, for example. x.appendchild(node) insert a child node to x x.removechild(node) Details can be found at https://www.w3schools.com/js/js_htmldom_document.asp 15

HTML DOM OBJECT MODEL Each node is an object. Objects have methods Can use methods to retrieve or change HTML content dynamically. We will cover HTML DOM again later. Basis for Dynamic HTML (DHTML) 16

DHTML DYNAMIC HTML Web requirements are very demanding. Not just static requirements. Check validity of input given on a web page. Ability to manipulate data dynamically based on User input Already available data. Provide animation Highlight a text area with a different color. Change behavior of images on mouse clicks, focus, etc. Solution: DHTML Ability to change HTML content dynamically. CS3101: Scripting Languages: Javascript Ramana Isukapalli 17

DHTML Components of HTML to support dynamic nature of content: CSS cascading style sheets To present the data HTML DOM Ability to access and change different portions (e.g., head, body, input, etc.) of a web page. Javascript Run scripts for various purposes Running scripts, creating cookies, animation, etc. This course is about Javascript. CS3101: Scripting Languages: Javascript Ramana Isukapalli 18

HTML FORMS We covered some HTML tags earlier. HTML form Another HTML tag Useful to send information from browser to server Can use other HTML tags <input> <button> <submit> <select> and <option> <textarea> Javascript functions can be used to verify HTML forms input 19

HTML FORM EXAMPLE <input id="id1" type="number" min="100" max="300" required> <button onclick="myfunction()">ok</button> <p id="demo"></p> <script> function myfunction() { var inpobj = document.getelementbyid("id1"); if (inpobj.checkvalidity() == false) { document.getelementbyid("demo").innerhtml = inpobj.validationmessage; } } </script> 20