JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.

Slides:



Advertisements
Similar presentations
Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Advertisements

Introducing JavaScript
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
JavaScript and the DOM Les Carr COMP3001 Les Carr COMP3001.
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
Multimedia and the World Wide Web HCI 201 Lecture Notes #8B.
20-Jun-15 JavaScript and HTML Simple Event Handling.
Information Technology Center Hany Abdelwahab Computer Specialist.
Computer Science 103 Chapter 4 Advanced JavaScript.
Web Development & Design Foundations with XHTML Chapter 14 Key Concepts.
JavaScript Client Side scripting. Client-side Scripts Client-side scripts, which run on the user’s workstation can be used to: Validate user inputs entered.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
JS: DOM Form Form Object Form Object –The Form object represents an HTML form. –For each instance of a tag in an HTML document, a Form object is created.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Chapter 19: Adding JavaScript
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
JavaScript II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
JavaScript Part 1.
Internet Mark-up Languages CO32036 Part Lecture: Elementary JavaScript.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
Using Client-Side Scripts to Enhance Web Applications 1.
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to Programming JScript Six Scripting functions Discuss functions Password Example.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
Event JavaScript's interaction with HTML is handled through events that occur when the user or browser manipulates a page. When the page loads, that is.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
Jaana Holvikivi 1 Introduction to Javascript Jaana Holvikivi Metropolia.
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
Project 8: Reacting to Events Essentials for Design JavaScript Level One Michael Brooks.
© 2007 D. J. ForemanJS-1 A Light Introduction for Non-programmers JavaScript for Beginners.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Web Programming Java Script & jQuery Web Programming.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
7. JavaScript Events. 2 Motto: Do you think I can listen all day to such stuff? –Lewis Carroll.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
JavaScript Event Handlers. Introduction An event handler executes a segment of a code based on certain events occurring within the application, such as.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Java Script Introduction. Java Script Introduction.
Web Development & Design Foundations with HTML5
JavaScript is a programming language designed for Web pages.
JavaScript.
14 A Brief Look at JavaScript and jQuery.
JavaScript Defined General Syntax Body vs. Head Variables Math & Logic
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
Introduction to JavaScript
Web Programming and Design
Barb Ericson Georgia Institute of Technology May 2006
Web Programming and Design
Presentation transcript:

JavaScript Informatics for economists I

Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client scripting language – script is sent with HTML document to web browser (client). JS is not Java. It has just similar syntax.

Characteristics Interpreted lang. – no compiling Object oriented – uses web browser and built-in objects Browser dependent Case sensitive Syntax is similar to C or Java language.

Limitations Works in web browser only. User can disable JS in browser. Many different JS versions. Cannot access to files or system object. Cannot save data.

Writing JS scripts Use tags. Example: document.write(“Hello world!”);

JS variables Initialized when firstly used. Case sensitive Example: var x, y; x=10; y=”Hallo”;

JS operators value assignment: = numeric operators: +, -, *, / logical operators: ==, !=,, =

Conditions Used to decide whether the expression is true or not if (expression) { commands when true; } else { commands when false; }

Cycles Used to repeat commands. while (expression) { commands; } for (initial value, condition, increment){ commands; }

Functions Frequently used part of program function name(params){ commands; return value; }

Object document Most frequently used object in JS. Contains everything on the page. document.forms document.images

Object Math Used with mathematical operations Math.abs(x)‏ Math.exp(x)‏ Math.pow(a,x)‏ Math.sqrt(x)‏ Math.PI

Events Activated when user does action onLoad – loading document onClick – cliking on object onDblClick – doubleclicking on object onMouseOver – move mouse over object onMouseOut – move mouse out of object onFocus – focusing object (activating)‏ onKeyPress – pressing key on object onSubmit – pressing submit form button

Communication with user Print information: alert(“some text”); document.write(“some text”); Get data from user: prompt(“prompt text”,”initial value”); parseInt, parseFloat Use forms: