JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Similar documents
E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161

Programing for Digital Media EE1707. Lecture 4 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

AIM. 10 September

Lesson 5: Multimedia on the Web

JavaScript CS 4640 Programming Languages for Web Applications

CS WEB TECHNOLOGY

Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.

Client-side Processing

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 14 Test Bank

JavaScript CS 4640 Programming Languages for Web Applications

COMS 469: Interactive Media II

Publishing On the Web. Course Content. Objectives of Lecture 7 Dynamic Pages

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

Programming for Digital Media. Lecture 7 JavaScript By: A. Mousavi and P. Broomhead SERG, School of Engineering Design, Brunel University, UK

<form>. input elements. </form>

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc.

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Helper Applications & Plug-Ins

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Introduction to Web Development

Outline. Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) What is JavaScript?

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Web Development & Design Foundations with HTML5

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

Web Site Development with HTML/JavaScrip

Lesson 5: Multimedia on the Web

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Programing for Digital Media EE1707. Lecture 3 JavaScript By: A. Mousavi and P. Broomhead SERG, School of Engineering Design, Brunel University, UK

CISH-6510 Web Application Design and Development. Overview of JavaScript. Overview

13. Databases on the Web

JavaScript Specialist v2.0 Exam 1D0-735

Introduction to DHTML

Interchange formats. Introduction Application areas Requirements Track and object model Real-time transfer Different interchange formats Comparison

Mobile MOUSe WEB SITE DESIGN ONLINE COURSE OUTLINE

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

Animating Layers with Timelines

CISC 1600 Lecture 2.4 Introduction to JavaScript

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

IT2353 WEB TECHNOLOGY Question Bank UNIT I 1. What is the difference between node and host? 2. What is the purpose of routers? 3. Define protocol. 4.

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

By the end of this section of the practical, the students should be able to:

CGS 3066: Spring 2015 JavaScript Reference

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

Languages in WEB. E-Business Technologies. Summer Semester Submitted to. Prof. Dr. Eduard Heindl. Prepared by

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

Introduction to WEB PROGRAMMING

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

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

IN Development in Platform Ecosystems Lecture 2: HTML, CSS, JavaScript

Developing Ajax Web Apps with GWT. Session I

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

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

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance.

Standard 1 The student will author web pages using the HyperText Markup Language (HTML)

Course 20480: Programming in HTML5 with JavaScript and CSS3

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Microsoft Programming in HTML5 with JavaScript and CSS3

EXERCISE: Introduction to client side JavaScript

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

(Refer Slide Time: 01:40)

ADDING FUNCTIONS TO WEBSITE

Programming in HTML5 with JavaScript and CSS3

Session 16. JavaScript Part 1. Reading

Contents. Acknowledgments

CIW 1D CIW JavaScript Specialist.

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

Fundamentals of Website Development

IMY 110 Theme 11 HTML Frames

Client vs Server Scripting

Html basics Course Outline

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


Creating Web Pages with HTML-Level III Tutorials HTML 6.01

Developing Apps for the BlackBerry PlayBook

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT

The behavioural layer (JavaScript) Content Management

JavaScript: Events, DOM and Attaching Handlers

Bookmarks to the headings on this page:

Elementary Computing CSC 100. M. Cheng, Computer Science

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains 2 components

Sections and Articles

5. JavaScript Basics

Session 6. JavaScript Part 1. Reading

Programming in HTML5 with JavaScript and CSS3

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

,

Introduction to using HTML to design webpages

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

Using AJAX to Easily Integrate Rich Media Elements


JavaScript: Introduction, Types

Scripting. Web Architecture and Information Management [./] Spring 2009 INFO (CCN 42509) Contents

710 Index Attributes, 127 action attribute, 263 assigning, bottom attribute, domain name attribute, 481 expiration date attribute, 480 8

Scripting for Multimedia LECTURE 1: INTRODUCING HTML5

Lecture 3: The Basics of JavaScript. Background. Needs for Programming Capability. Origin of JavaScript. Using Client-side JavaScript

Unit 4. CRM - Web Marketing 4-1

Demonstrate web development using appropriate HTML markup tags, elements and attributes.

Transcription:

Programming for Digital Media EE1707 JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK 1

References and Sources 1. Javascript & JQuery: interactive front-end Web development - Jon Duckett, Gilles Ruppert, Jack Moore c2014 2. Understanding ECMAScript 6: The Definitive Guide for JavaScript Developers 30 Sept. 2016 3. DOM scripting: web design with JavaScript and the Document Object Model - Jeremy Keith c2010 4. Lecture notes and other supporting material on http://people.brunel.ac.uk/~emstaam/ The Blackboard 2

Content of lectures 1. Introduction to JavaScript: Brief History Client-Side and Server-Side JavaScript What is Data Object Model (DOM) Dynamic HTML and Browsers Some elementary concepts and JavaScript Syntax 2. Java Script Syntax Statements Variables and arrays Operators Conditional and looping statements Functions and objects 3

Content of lectures continued 3. Objects and DOM Built-in objects, browser object models Document Object Model (DOM) Client-Side validation of input Programming with JavaScript What can we do to date? 4. Event Handling Event Handlers Image objects 5. Forms Manipulating fields Interactive Forms 4

Content of lectures continued 7. Objects/JSON 8. AJAX 5

Introduction to JavaScript Today s topics: 1. Brief History 2. Client-Side and Server-Side JavaScript 3. What is Document Object Model (DOM) 4. Dynamic HTML and Browsers 5. Some elementary concepts and JavaScript Syntax 6

JavaScript History Was developed by Netscape and Sun Microsystems Not Java To make websites more interesting and dynamic To interact with server side applications and Databases VBScript and Jscript by Microsoft Collaboration with European Computer Manufacturers Association (ECMA) ECMAScript Scripting language tells the browser what to do 7

Facts Can be created using any text editor Case sensitive The code can be included in an HTML document using <script></script> tags but it is better to put your JavaScript code in a separate file filename.js and then call it with the <script> tag Note that the target Browser supports JavaScript otherwise it will be ignored. Ex: <script language="javascript1.6"> Use the body to trigger events that calls specified functions JavaScript used to be included in the <head> - but not anymore The Head section always loads first and then the <body> can safely refer to it Interpreted codes and compiled languages 8

Browser Object Model JavaScript allows you to control how data is presented in a browser Things like: The properties of browser window can be manipulated (e.g. height, width, position) 9

Document Object Model (DOM) By using DOM we can manage and describe the contents of a document Objects contain properties and methods It allows you to define What it is image, form etc. 10

Dynamic HTML Integration of HTML, Cascading Style Sheets (CSS) and JavaScript Principles of DHTML: use HTML to mark up web page into elements use CSS to arrange and manage those elements use JavaScript to dynamically change the appearance and styles Using DHTML you could suddenly create complex animation effects Clash of Browsers!!! 11

Example Define an element: <div id= anelement > This is an element </div> Then use the CSS to apply positioning: #anelement { position: absolute; left: 50px top: 100px } Use DOM property element called layers. The layers having unique ID. And then using JavaScript document.layers[ anelement ] 12

Cascade Style Sheets and JavaScript How a content of a page is represented can be defined by style sheets. The contents of a web page is influenced by style sheets through tags and elements. Cascading Style Sheets (CSS) & CSS-DOM Is a style sheet mechanism that has been specifically developed to meet the needs of Web designers and users. A CSS file can be created and edited manually with a text editor, but one can also write a program in a scripting language i.e. JavaScript that manipulates a style sheet. The CSS Document Object Model is an API for manipulating CSS from within the program. 13

Clash of Browsers A struggle between various browsers W3C involvement DOM standardisation in-built in the latest browsers 14

Client-Side and Serve-Side apps Client-Side What happens on your browser Server-Side What happens on the remote/local server 15

Client-Side JavaScript 1. Generate and modify HTML content on-fly 2. Lively interaction with the user: Multimedia, images, animation (image manipulation), links Pop-up Prompts, alerts and dialog boxes Interactive forms with field validation on client-side 3. Deal with Cookies reset and store 4. Simple computations 5. Manage embedded Java applets and plug-ins 16

Limits of Client-Side JavaScript 1. Limitations in directly drawing graphics 2. Does not really interact with the underlying file systems and OS 3. Cannot support multithreading 4. Unable to use arbitrary network connections but able to load documents from arbitrary URLs 17

Server-Side JavaScript 1. Extends functionality for customised web applications 2. Interaction with database systems via ODBC, JDBC, 3. Read and write server files 4. Invoke programs residing in the server 5. Establish arbitrary network connections 18

Short example 1 <!-- Document : Test 1 Author : emstaam --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title> Test 1 </title> <script type="text/javascript"> function show_alert( ) { alert("i am an alert box!"); } </script> </head> <body> <input type="button" onclick="show_alert( )" value="show alert box" /> </body> </html> 19

Short example 2 Create a file in the same directory as your html file. Call it alertbox.js. Type in: function show_alert( ) { alert ( I am an Alert Box! ); } and save. In your html file write your code: <html> <head> <script src= alertbox.js"> </script> </head> <body> <input type="button" onclick="show_alert( )" value= Show alert box!"> </body> </html> What is the difference between example 1 and 2? 20