Exercise 1: Basic HTML and JavaScript

Size: px
Start display at page:

Download "Exercise 1: Basic HTML and JavaScript"

Transcription

1 Exercise 1: Basic HTML and JavaScript Question 1: Table Create HTML markup that produces the table as shown in Figure 1. Figure 1 Question 2: Spacing Spacing can be added using CellSpacing and CellPadding to a table. Create HTML markup that produces the table as shown in Figure 2. Figure 2

2 Question 3: Form Create HTML markup that produces a form as shown in Figure 3. Note that when the button submit is clicked, the form will be submitted to an address that you specify. Question 4 Figure 3 JavaScript is an interpreted scripting language. The code can be incorporated using the <script> tag to the html document as follows:

3 <script type= text/javascript > As the first example, the code document.writeln("<h1> Hello world </h1>"); simply displays the words Hello world using h1 header in the browser. <head> <title> First example </title> document.writeln("<h1> Hello world </h1>"); </head> <body> </body> </html> (a): Case sensitive? Using the above hello world example, test whether JavaScript is case sensitive. You can replace writeln by WRITELN to see the result. (b): Alert and prompt windows Two commonly used pop-ups in JavaScript are the alert and the prompt windows. Their formats for usage are as follows: var name = window.prompt ( Enter your name please, myname ); window.alert ( hello +name); User is requested to enter the name through the prompt window and a greeting message is displayed using the alert window. <head> <title> Second example </title> var name = window.prompt ("Enter your name please", "myname"); window.alert ("Hello! " + name); </head> <body> </body> </html> 1. A prompt window is displayed in which the user enters the name. 2. After the user presses OK, a greeting message is displayed.

4 Modify the above example, so that two prompt windows appear one by one. The first prompt window asks for user s name while the second asks for the user s student id. The student id would be printed on the html document while the greeting message appears in the alert window. (c): investigate the use of parseint or parsefloat functions. (i) Run the following program, and investigate the use of the function parsefloat. <head> <title> Third example </title> function maximum (x,y) { return Math.max(x,y); var input1 = window.prompt("enter a number: ", 0); var input2 = window.prompt("enter another number: ", 0); var value1 = parsefloat(input1); var value2 = parsefloat(input2); var maxvalue = maximum(value1, value2); var add1 = input1 + input2; var add2 = value1 + value2; document.writeln("<h1> First number: " + value1 + "</h1>"); document.writeln("<h1> Second number: " + value2 + "</h1>"); document.writeln("<h1> maximum: " + maxvalue + "</h1>"); document.writeln("<h1> add1: " + add1 + "</h1>"); document.writeln("<h1> add2: " + add2 + "</h1>");

5 <head> <body></body> </html> (ii) Modify the example in (i) to prompt user to input three numbers. The first two numbers should be concatenated into one single number. A new function sum(x,y) is then used to calculate the sum of this concatenated number and the third input number. The two numbers and the sum should be printed on three separated lines. As an example, the user has inputted three numbers as 1, 2, and 3. The first number and the second number are concatenated to form 12. This is added to 3 to give a sum of 15. These numbers are then displayed as follows. (d): Control structures The following table summarizes syntax for a few control structures in JavaScript. Decision Structure Syntax Example if if (condition) if (a > b) min=b if/else if (condition) else if (a > b) min=b else min=a while while (condition) do-while do { while (condition) for for (initialization; condition; increment) { switch switch(choice) { case 1 : statements; break; i=0; while (i<10) i++; i=0; do { i++ while (i<10) for (i=0;i<10;i++) a=i*i;

6 case 2 : statements; break; default: statements; (i) The following code shows an example of calculating the sum of an input integer n by using the switch statement. The integer n must be greater than 0, but cannot be larger than 3. <head> <title> Fourth example </title> var input = window.prompt("enter a number (1-3) : ", 0); var value = parsefloat(input); var sum = 0; if ((value < 0) (value > 3)) { window.alert ("The number is out of range!"); else { switch (value) { case 3: sum += 3; case 2: sum += 2; case 1: sum += 1; document.writeln("result: " + sum); </head> <body> </body> </html> Modify the above codes so that user is allowed to input the number between 1 and 5. You should still use the switch statement. (ii) When the range is getting large, the number of cases in the switch statement will increase. A for-loop can be used to replace the switch statement. Modify the code in (i) using the for-loop so that user is allowed to input a number between 1 and 45. (iii) Modify (ii) so that if the user inputs an out-of-range number, the user is allowed to input the number again until the number is within the range by using a do-while loop.

c122mar413.notebook March 06, 2013

c122mar413.notebook March 06, 2013 These are the programs I am going to cover today. 1 2 Javascript is embedded in HTML. The document.write() will write the literal Hello World! to the web page document. Then the alert() puts out a pop

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

Program Design Phase. Algorithm Design - Mathematical. Algorithm Design - Sequence. Verify Algorithm Y = MX + B

Program Design Phase. Algorithm Design - Mathematical. Algorithm Design - Sequence. Verify Algorithm Y = MX + B Program Design Phase Write Program Specifications Analysis of requirements Program specifications description Describe what the goals of the program Describe appearance of input and output Algorithm Design

More information

introjs.notebook March 02, 2014

introjs.notebook March 02, 2014 1 document.write() uses the write method to write on the document. It writes the literal Hello World! which is enclosed in quotes since it is a literal and then enclosed in the () of the write method.

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Data Types & Variables Decisions, Loops, and Functions Review gunkelweb.com/coms469 Review Basic Terminology Computer Languages Interpreted vs. Compiled Client

More information

Programming language components

Programming language components Programming language components syntax: grammar rules for defining legal statements what's grammatically legal? how are things built up from smaller things? semantics: what things mean what do they compute?

More information

JavaScript: Introduction to Scripting

JavaScript: Introduction to Scripting iw3htp2.book Page 194 Wednesday, July 18, 2001 9:01 AM 7 JavaScript: Introduction to Scripting Objectives To be able to write simple JavaScript programs. To be able to use input and output statements.

More information

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

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Write JavaScript to generate HTML Create simple scripts which include input and output statements, arithmetic, relational and

More information

The first sample. What is JavaScript?

The first sample. What is JavaScript? Java Script Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. In this lecture

More information

People = End Users & Programmers. The Web Browser Application. Program Design Phase. Algorithm Design -Mathematical Y = MX + B

People = End Users & Programmers. The Web Browser Application. Program Design Phase. Algorithm Design -Mathematical Y = MX + B The Web Browser Application People = End Users & Programmers Clients and Components Input from mouse and keyboard Controller HTTP Client FTP Client TCP/IP Network Interface HTML/XHTML CSS JavaScript Flash

More information

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies Internet t Software Technologies JavaScript part one IMCNE A.A. 2008/09 Gabriele Cecchetti Why introduce JavaScript To add dynamicity and interactivity to HTML pages 2 What s a script It s a little interpreted

More information

JavaScript: The Basics

JavaScript: The Basics JavaScript: The Basics CISC 282 October 4, 2017 JavaScript A programming language "Lightweight" and versatile Not universally respected Appreciated in the web domain Adds programmatic functionality to

More information

JavaScript: Introductionto Scripting

JavaScript: Introductionto Scripting 6 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask, What would be the most fun? Peggy Walker Equality,

More information

CHAPTER 5: JavaScript Basics 99

CHAPTER 5: JavaScript Basics 99 CHAPTER 5: JavaScript Basics 99 5.2 JavaScript Keywords, Variables, and Operators 5.2.1 JavaScript Keywords break case continue default delete do else export false for function if import in new null return

More information

JAVASCRIPT BASICS. Type-Conversion in JavaScript. Type conversion or typecasting is one of the very important concept in

JAVASCRIPT BASICS. Type-Conversion in JavaScript. Type conversion or typecasting is one of the very important concept in Type-Conversion in JavaScript Description Type conversion or typecasting is one of the very important concept in JavaScript. It refers to changing an entity or variable from one datatype to another. There

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore 560 100 WEB PROGRAMMING Solution Set II Section A 1. This function evaluates a string as javascript statement or expression

More information

Agenda. My Introduction. CIS 154 Javascript Programming

Agenda. My Introduction. CIS 154 Javascript Programming CIS 154 Javascript Programming Brad Rippe brippe@fullcoll.edu Agenda Brief Javascript Introduction Course Requirements Brief HTML review On to JavaScript Assignment 1 Due Next week Helpful Tools Questions/Comments

More information

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

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages

More information

(from Chapters 10/11 of the text)

(from Chapters 10/11 of the text) IT350 Web and Internet Programming SlideSet #10: JavaScript Arrays and Objects (from Chapters 10/11 of the text) Everything you ever wanted to know about arrays function initializearrays() var n1 = new

More information

Web Programming/Scripting: JavaScript

Web Programming/Scripting: JavaScript CS 312 Internet Concepts Web Programming/Scripting: JavaScript Dr. Michele Weigle Department of Computer Science Old Dominion University mweigle@cs.odu.edu http://www.cs.odu.edu/~mweigle/cs312-f11/ 1 Outline!

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

CHAPTER 6 JAVASCRIPT PART 1

CHAPTER 6 JAVASCRIPT PART 1 CHAPTER 6 JAVASCRIPT PART 1 1 OVERVIEW OF JAVASCRIPT JavaScript is an implementation of the ECMAScript language standard and is typically used to enable programmatic access to computational objects within

More information

JavaScript: Introduction, Types

JavaScript: Introduction, Types JavaScript: Introduction, Types Computer Science and Engineering College of Engineering The Ohio State University Lecture 19 History Developed by Netscape "LiveScript", then renamed "JavaScript" Nothing

More information

JAVASCRIPT LESSON 4: FUNCTIONS

JAVASCRIPT LESSON 4: FUNCTIONS JAVASCRIPT LESSON 4: FUNCTIONS 11.1 Introductio n Programs that solve realworld programs More complex than programs from previous chapters Best way to develop & maintain large program: Construct from small,

More information

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

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Learn about the Document Object Model and the Document Object Model hierarchy Create and use the properties, methods and event

More information

Namma Kalvi.

Namma Kalvi. Namma Kalvi COMPUTER APPLICATION PUBLIC EXAM - 2019 ANSWER KEY PART - A I Choose the correct answer 10x1=10 1. c. warm booting 6. d. All the above 11. d..css 2. c. Giga 7. d. 2 12. b. F5 3. b. VGA connector

More information

JavaScript Introduction

JavaScript Introduction JavaScript Introduction What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means

More information

3 The Building Blocks: Data Types, Literals, and Variables

3 The Building Blocks: Data Types, Literals, and Variables chapter 3 The Building Blocks: Data Types, Literals, and Variables 3.1 Data Types A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validating

More information

write vs. writeln Prompting as Page Loads Today s Goals CSCI 2910 Client/Server-Side Programming Intermediate File vs. HTML Output

write vs. writeln Prompting as Page Loads Today s Goals CSCI 2910 Client/Server-Side Programming Intermediate File vs. HTML Output CSCI 2910 Client/Server-Side Programming Topic: JavaScript Part 2 Today s Goals Today s lecture will cover: More objects, properties, and methods of the DOM The Math object Introduction to form validation

More information

Chapter 8 JavaScript/JScript: Introduction to Scripting 201

Chapter 8 JavaScript/JScript: Introduction to Scripting 201 iw3htp_08.fm Page 201 Thursday, April 13, 2000 12:30 PM Chapter 8 JavaScript/JScript: Introduction to Scripting 201 8 JavaScript/JScript: Introduction to Scripting 1

More information

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,

More information

JavaScript s role on the Web

JavaScript s role on the Web Chris Panayiotou JavaScript s role on the Web JavaScript Programming Language Developed by Netscape for use in Navigator Web Browsers Purpose make web pages (documents) more dynamic and interactive Change

More information

ORB Education Quality Teaching Resources

ORB Education Quality Teaching Resources JavaScript is one of the programming languages that make things happen in a web page. It is a fantastic way for students to get to grips with some of the basics of programming, whilst opening the door

More information

Chapter 1 Introduction to Computers and the Internet

Chapter 1 Introduction to Computers and the Internet CPET 499/ITC 250 Web Systems Dec. 6, 2012 Review of Courses Chapter 1 Introduction to Computers and the Internet The Internet in Industry & Research o E Commerce & Business o Mobile Computing and SmartPhone

More information

Lecture 2. The variable 'x' can store integers, characters, string, float, boolean.

Lecture 2. The variable 'x' can store integers, characters, string, float, boolean. In this lecture we will learn 1 Arrays 2 Expressions and Operators 3 Functions 4 If-else construct 5 Switch Construct 6 loop constructs For While do-while Lecture 2 More about data types As I told in my

More information

Place User-Defined Functions in the HEAD Section

Place User-Defined Functions in the HEAD Section JavaScript Functions Notes (Modified from: w3schools.com) A function is a block of code that will be executed when "someone" calls it. In JavaScript, we can define our own functions, called user-defined

More information

COMP 110 Practice Exercises for Midterm Solutions

COMP 110 Practice Exercises for Midterm Solutions 1 COMP 110 Practice Exercises for Midterm Solutions Answers are highlighted in blue color. Evaluate each of the following Javascript expressions and show the value. 1. 9*3 27 2. value is + 50 value is

More information

CITS1231 Web Technologies. JavaScript Math, String, Array, Number, Debugging

CITS1231 Web Technologies. JavaScript Math, String, Array, Number, Debugging CITS1231 Web Technologies JavaScript Math, String, Array, Number, Debugging Last Lecture Introduction to JavaScript Variables Operators Conditional Statements Program Loops Popup Boxes Functions 3 This

More information

Chapter 3 - Simple JavaScript - Programming Basics. Lesson 1 - JavaScript: What is it and what does it look like?

Chapter 3 - Simple JavaScript - Programming Basics. Lesson 1 - JavaScript: What is it and what does it look like? Chapter 3 - Simple JavaScript - Programming Basics Lesson 1 - JavaScript: What is it and what does it look like? PP presentation JavaScript.ppt. Lab 3.1. Lesson 2 - JavaScript Comments, document.write(),

More information

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh Web Programming and Design MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh Plan for the next 5 weeks: Introduction to HTML tags, creating our template file Introduction to CSS and style

More information

LECTURE-2. Functions review HTML Forms. Arrays Exceptions Events. CS3101: Scripting Languages: Javascript Ramana Isukapalli

LECTURE-2. Functions review HTML Forms. Arrays Exceptions Events. CS3101: Scripting Languages: Javascript Ramana Isukapalli LECTURE-2 Functions review HTML Forms Arrays Exceptions Events 1 JAVASCRIPT FUNCTIONS, REVIEW Syntax function (params) { // code Note: Parameters do NOT have variable type. 1. Recall: Function

More information

334 JavaScript/JScript: Functions Chapter 11. boss. worker1 worker2 worker3. Hierarchical boss function/worker function relationship.

334 JavaScript/JScript: Functions Chapter 11. boss. worker1 worker2 worker3. Hierarchical boss function/worker function relationship. . iw3htp_11.fm Page 334 Thursday, April 13, 2000 12:33 PM 334 JavaScript/JScript: Functions Chapter 11 11 JavaScript/JScript: Functions boss worker1 worker2 worker3 worker4 worker5 Fig. 11.1 Hierarchical

More information

Chapter 9 - JavaScript: Control Structures II

Chapter 9 - JavaScript: Control Structures II Chapter 9 - JavaScript: Control Structures II Outline 9.1 Introduction 9.2 Essentials of Counter-Controlled Repetition 9.3 for Repetition Structure 9. Examples Using the for Structure 9.5 switch Multiple-Selection

More information

Introduction to JavaScript

Introduction to JavaScript 127 Lesson 14 Introduction to JavaScript Aim Objectives : To provide an introduction about JavaScript : To give an idea about, What is JavaScript? How to create a simple JavaScript? More about Java Script

More information

<script type="text/javascript"> script commands </script>

<script type=text/javascript> script commands </script> JavaScript Java vs. JavaScript JavaScript is a subset of Java JavaScript is simpler and less powerful than Java JavaScript programs can be embedded within HTML files; Java code must be separate Java code

More information

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts

COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Command-driven, event-driven, and web-based software

Command-driven, event-driven, and web-based software David Keil Spring 2009 Framingham State College Command-driven, event-driven, and web-based software Web pages appear to users as graphical, interactive applications. Their graphical and interactive features

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

(Refer Slide Time: 01:40)

(Refer Slide Time: 01:40) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #25 Javascript Part I Today will be talking about a language

More information

INTRODUCTION TO JAVASCRIPT

INTRODUCTION TO JAVASCRIPT INTRODUCTION TO JAVASCRIPT Overview This course is designed to accommodate website designers who have some experience in building web pages. Lessons familiarize students with the ins and outs of basic

More information

Chapter 7: Javascript: Control Statements. Background and Terminology. Background and Terminology. Background and Terminology

Chapter 7: Javascript: Control Statements. Background and Terminology. Background and Terminology. Background and Terminology Chapter 7: Javascript: Control Statements CS 80: Internet Programming Instructor: Mark Edmonds Background and Terminology Algorithm What is an algorithm? A procedure for solving a problem. Consists of:

More information

JavaScript: Control Statements I Pearson Education, Inc. All rights reserved.

JavaScript: Control Statements I Pearson Education, Inc. All rights reserved. 1 7 JavaScript: Control Statements I 2 Let s all move one place on. Lewis Carroll The wheel is come full circle. William Shakespeare How many apples fell on Newton s head before he took the hint! Robert

More information

Webinar. The Lighthouse Studio Scripting Series. JavaScript Sawtooth Software, Inc.

Webinar. The Lighthouse Studio Scripting Series. JavaScript Sawtooth Software, Inc. The Lighthouse Studio Scripting Series JavaScript 2 HTML 3 CSS 4 JavaScript 5 jquery (enhanced JavaScript) 6 Perl 7 HTML (Hyper Text Markup Language) 8 HTML 9 What is HTML? HTML is the language for creating

More information

5/19/2015. Objectives. JavaScript, Sixth Edition. Understanding Syntax Errors. Introduction to Debugging. Handling Run-Time Errors

5/19/2015. Objectives. JavaScript, Sixth Edition. Understanding Syntax Errors. Introduction to Debugging. Handling Run-Time Errors Objectives JavaScript, Sixth Edition Chapter 4 Debugging and Error Handling When you complete this chapter, you will be able to: Recognize error types Trace errors with dialog boxes and the console Use

More information

Mobile Site Development

Mobile Site Development Mobile Site Development HTML Basics What is HTML? Editors Elements Block Elements Attributes Make a new line using HTML Headers & Paragraphs Creating hyperlinks Using images Text Formatting Inline styling

More information

Current trends: Scripting (I) A bid part of interface design centers around dialogs

Current trends: Scripting (I) A bid part of interface design centers around dialogs Current trends: Scripting (I) A bid part of interface design centers around dialogs that a system has with a user of the system These dialogs follow what is usually called a "script", i.e. a sequence of

More information

Lotus Using JavaScript in IBM Lotus Domino 7 Applications.

Lotus Using JavaScript in IBM Lotus Domino 7 Applications. Lotus 190-753 Using JavaScript in IBM Lotus Domino 7 Applications http://killexams.com/exam-detail/190-753 B. Remove the input validation formulas. Code a function to validate the user input and call this

More information

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 (

Course Syllabus. Course Title. Who should attend? Course Description. PHP ( Level 1 ( Course Title PHP ( Level 1 ( Course Description PHP '' Hypertext Preprocessor" is the most famous server-side programming language in the world. It is used to create a dynamic website and it supports many

More information

CISC 1600 Lecture 2.4 Introduction to JavaScript

CISC 1600 Lecture 2.4 Introduction to JavaScript CISC 1600 Lecture 2.4 Introduction to JavaScript Topics: Javascript overview The DOM Variables and objects Selection and Repetition Functions A simple animation What is JavaScript? JavaScript is not Java

More information

COMP519 Practical 5 JavaScript (1)

COMP519 Practical 5 JavaScript (1) COMP519 Practical 5 JavaScript (1) Introduction This worksheet contains exercises that are intended to familiarise you with JavaScript Programming. While you work through the tasks below compare your results

More information

Session 3: JavaScript - Structured Programming

Session 3: JavaScript - Structured Programming INFM 603: Information Technology and Organizational Context Session 3: JavaScript - Structured Programming Jimmy Lin The ischool University of Maryland Thursday, September 25, 2014 Source: Wikipedia Types

More information

Client-side Techniques. Client-side Techniques HTML/XHTML. Static web pages, Interactive web page: without depending on interaction with a server

Client-side Techniques. Client-side Techniques HTML/XHTML. Static web pages, Interactive web page: without depending on interaction with a server Client-side Techniques Client-side Techniques Static web pages, Interactive web page: without depending on interaction with a server HTML/XHTML: content Cascading Style Sheet (CSS): style and layout Script

More information

Lesson 6: Introduction to Functions

Lesson 6: Introduction to Functions JavaScript 101 6-1 Lesson 6: Introduction to Functions OBJECTIVES: In this lesson you will learn about Functions Why functions are useful How to declare a function How to use a function Why functions are

More information

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

Standard 1 The student will author web pages using the HyperText Markup Language (HTML) I. Course Title Web Application Development II. Course Description Students develop software solutions by building web apps. Technologies may include a back-end SQL database, web programming in PHP and/or

More information

Notesc120Mar515.notebook. March 05, Next I want to change the logic to handle all four of these:

Notesc120Mar515.notebook. March 05, Next I want to change the logic to handle all four of these: Next I want to change the logic to handle all four of these: Note after the else I have two curly braces and embedded inside them I ask the next question and deal with its yes and its no. 1 Flowchart of

More information

CITS1231 Web Technologies. JavaScript

CITS1231 Web Technologies. JavaScript CITS1231 Web Technologies JavaScript Contents Introduction to JavaScript Variables Operators Conditional Statements Program Loops Popup Boxes Functions 2 User Interaction User interaction requires web

More information

JAVASCRIPT. Computer Science & Engineering LOGO

JAVASCRIPT. Computer Science & Engineering LOGO JAVASCRIPT JavaScript and Client-Side Scripting When HTML was first developed, Web pages were static Static Web pages cannot change after the browser renders them HTML and XHTML could only be used to produce

More information

Session 6. JavaScript Part 1. Reading

Session 6. JavaScript Part 1. Reading Session 6 JavaScript Part 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/ JavaScript Debugging www.w3schools.com/js/js_debugging.asp

More information

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

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors. HTML HTML/XHTML HyperText Mark-up Language Basic language for WWW documents Format a web page s look, position graphics and multimedia elements Describe document structure and formatting Platform independent:

More information

Lesson 7: If Statement and Comparison Operators

Lesson 7: If Statement and Comparison Operators JavaScript 101 7-1 Lesson 7: If Statement and Comparison Operators OBJECTIVES: In this lesson you will learn about Branching or conditional satements How to use the comparison operators: ==,!=, < ,

More information

Looping Subtasks. We will examine some basic algorithms that use the while and if constructs. These subtasks include

Looping Subtasks. We will examine some basic algorithms that use the while and if constructs. These subtasks include 1 Programming in C Looping Subtasks We will examine some basic algorithms that use the while and if constructs. These subtasks include Reading unknown quantity of data Counting things Accumulating (summing)

More information

Programming for Experimental Research. Flow Control

Programming for Experimental Research. Flow Control Programming for Experimental Research Flow Control FLOW CONTROL In a simple program, the commands are executed one after the other in the order they are typed. Many situations require more sophisticated

More information

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser?

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser? UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? A 1: A text editor is a program that helps you write plain text (without any formatting) and save it to a file. A good example is

More information

What is PHP? [1] Figure 1 [1]

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from BEFORE CLASS If you haven t already installed the Firebug extension for Firefox, download it now from http://getfirebug.com. If you don t already have the Firebug extension for Firefox, Safari, or Google

More information

JOHNSON COUNTY COMMUNITY COLLEGE COURSE SYLLABUS WEB CRN Web Scripting: JavaScript I

JOHNSON COUNTY COMMUNITY COLLEGE COURSE SYLLABUS WEB CRN Web Scripting: JavaScript I JOHNSON COUNTY COMMUNITY COLLEGE COURSE SYLLABUS WEB 114-002 CRN 12234 Web Scripting: JavaScript I TERM: Spring 2017 DIVISION: Computing Sciences & Information Technology CREDITS: 2 Pre/Corequisite: WEB

More information

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

Time: 3 hours. Full Marks: 70. The figures in the margin indicate full marks. Answer from all the Groups as directed. Group A. COPYRIGHT RESERVED End SEM (V) MCA (XXX) 2017 Time: 3 hours Full Marks: 70 Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full

More information

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 12

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 12 CS4PM Web Aesthetics and Development WEEK 12 Objective: 1. Understand the basic operations in JavaScript 2. Understand and Prepare a 3 page Website (Homework for Week 15) 3. Finish Quiz 2 Outline: a. Basics

More information

Lab 1. Purpose. Assignment. Action Items/Programming Requirements

Lab 1. Purpose. Assignment. Action Items/Programming Requirements Lab 1 Purpose To assess your ability to apply the knowledge and skills developed in weeks 1 through 4. Emphasis will be placed on the following learning outcomes: 1. Create and display simple syntactically

More information

10.) Click on the Security tab in Internet Options. 11.) Then click on Trusted Sites. 12.) Click on the Custom level button.

10.) Click on the Security tab in Internet Options. 11.) Then click on Trusted Sites. 12.) Click on the Custom level button. Kannapolis Archibus as a trusted website If you have problems logging into Kannapolis Archibus to create a Work Request, you may need to make sure that Kannapolis Archibus is a trusted site on your web

More information

Browser behavior can be quite complex, using more HTTP features than the basic exchange, this trace will show us how much gets transferred.

Browser behavior can be quite complex, using more HTTP features than the basic exchange, this trace will show us how much gets transferred. Lab Exercise HTTP Objective HTTP (HyperText Transfer Protocol) is the main protocol underlying the Web. HTTP functions as a request response protocol in the client server computing model. A web browser,

More information

(from Chapter 10/11 of the text)

(from Chapter 10/11 of the text) IT350 Web and Internet Programming Fall 2008 SlideSet #9: JavaScript Arrays, Objects, & Cookies (from Chapter 10/11 of the text) Everything you ever wanted to know about arrays function initializearrays()

More information

Web System and Technologies (Objective + Subjective)

Web System and Technologies (Objective + Subjective) 1. What four components are needed to create a fully dynamic web page. A web server (such as Apache), a server-side scripting language (PHP), a database (MySQL), and a client-side scripting language (JavaScript)

More information

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

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 14 Test Bank Multiple Choice. Choose the best answer. 1. JavaScript can be described as: a. an object-oriented scripting language b. an easy form of Java c. a language created by Microsoft 2. Select the true statement

More information

Lab 2 Population. Purpose. Assignment Lab 2 analyzes population growth of a town as well as compare the population growth of two towns.

Lab 2 Population. Purpose. Assignment Lab 2 analyzes population growth of a town as well as compare the population growth of two towns. Lab 2 Population Purpose To assess your ability to apply the knowledge and skills developed up though week 7. Emphasis will be placed on the following learning outcomes: 1. Decompose a problem into modularized

More information

<form>. input elements. </form>

<form>. input elements. </form> CS 183 4/8/2010 A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, text area fields, drop-down menus, radio buttons,

More information

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript 1 Objectives JavaScript client-side programming Example of a JavaScript program The element

More information

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1 Objectives INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript JavaScript client-side programming Example of a JavaScript program The element

More information

Variables and Typing

Variables and Typing Variables and Typing Christopher M. Harden Contents 1 The basic workflow 2 2 Variables 3 2.1 Declaring a variable........................ 3 2.2 Assigning to a variable...................... 4 2.3 Other

More information

A Web-Based Introduction

A Web-Based Introduction A Web-Based Introduction to Programming Essential Algorithms, Syntax, and Control Structures Using PHP, HTML, and MySQL Third Edition Mike O'Kane Carolina Academic Press Durham, North Carolina Contents

More information

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

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery. HTML5/CSS3/JavaScript Programming Course Summary Description This class is designed for students that have experience with basic HTML concepts that wish to learn about HTML Version 5, Cascading Style Sheets

More information

A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University 2011 Pearson Prentice Hall ISBN

A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University 2011 Pearson Prentice Hall ISBN A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University 2011 Pearson Prentice Hall ISBN 978-0-13-216675-1 Chapter 5 JavaScript and User Interaction 1 Text Boxes HTML event handlers

More information

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser. Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible

More information

Session 16. JavaScript Part 1. Reading

Session 16. JavaScript Part 1. Reading Session 16 JavaScript Part 1 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript / p W3C www.w3.org/tr/rec-html40/interact/scripts.html Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Ch. 5: JavaScript An Object-Based Language Ch. 6: Programming the Browser Review Data Types & Variables Data Types Numeric String Boolean Variables Declaring

More information

PIC 40A. Lecture 10: JS: Wrapper objects, Input and Output, Control structures, random numbers. Copyright 2011 Jukka Virtanen UCLA 1 04/24/17

PIC 40A. Lecture 10: JS: Wrapper objects, Input and Output, Control structures, random numbers. Copyright 2011 Jukka Virtanen UCLA 1 04/24/17 PIC 40A Lecture 10: JS: Wrapper objects, Input and Output, Control structures, random numbers 04/24/17 Copyright 2011 Jukka Virtanen UCLA 1 Objects in JS In C++ we have classes, in JS we have OBJECTS.

More information

Dynamism and Detection

Dynamism and Detection 1 Dynamism and Detection c h a p t e r ch01 Page 1 Wednesday, June 23, 1999 2:52 PM IN THIS CHAPTER Project I: Generating Platform-Specific Content Project II: Printing Copyright Information and Last-Modified

More information

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010 Lecture 15 Javascript Announcements Project #1 Graded VG, G= doing well, OK = did the minimum, OK - = some issues, do better on P#2 Homework #6 posted, due 11/5 Get JavaScript by Example Most examples

More information

Coding in JavaScript functions

Coding in JavaScript functions Coding in JavaScript functions A function contains code that will be executed by an event or by a call to the function. You may call a function from anywhere within a page (or even from other pages if

More information