Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

Java Script Session1 INTRODUCTION.
The Web Warrior Guide to Web Design Technologies
CS 898N – Advanced World Wide Web Technologies Lecture 14: JavaScript Chin-Chih Chang
Multimedia and the World Wide Web HCI 201 Lecture Notes #8B.
Tutorial 10 Programming with JavaScript
Information Technology Center Hany Abdelwahab Computer Specialist.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to scripting
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
Javascript and the Web Whys and Hows of Javascript.
Introduction to JavaScript. JavaScript Facts A scripting language - not compiled but interpreted line by line at run-time. Platform independent. It is.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript Part 1.
JavaScript Part 1.
JavaScript 1. What is JavaScript? JavaScript allows web authors to create dynamic pages that react to user interaction. It is an Object-based because.
JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
1 JavaScript in Context. Server-Side Programming.
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Intro to JavaScript. Some simple examples Examples from our webpage Examples from Andrews webpage Today’s Example.
1 JavaScript
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
1 JavaScript in Context. Server-Side Programming.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Java Script About Java Script Document Object Model Incorporating JavaScript Adding JavaScript to HTML Embedding a Javascript External Scripts Javascript.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Chapter 4 Java Script - Part1. 2 Outlines Introduction to Java Script Variables, Operators and Functions Conditional statements JavaScript Objects Forms.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript: A short introduction Joseph Lee Created by Joseph Lee.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
Java Script Introduction. Java Script Introduction.
“Under the hood”: Angry Birds Maze
Tutorial 10 Programming with JavaScript
JavaScript is a programming language designed for Web pages.
Donna J. Kain, Clarkson University
JavaScript.
14 A Brief Look at JavaScript and jQuery.
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
JavaScript What is JavaScript? What can JavaScript do?
Tutorial 10 Programming with JavaScript
JavaScript What is JavaScript? What can JavaScript do?
“Under the hood”: Angry Birds Maze
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
Presentation transcript:

Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such as Pascal, C, Basic etc. Fourth Generation  Non-procedural language, more natural. 1

Machine language

Assembly Language mov al, 061h 3

Popular Programming Languages FORTRAN — the oldest high-level programming language; designed for scientific and mathematical applications. 4

Popular Programming Languages, Cont ’ d. COBOL — designed for business transaction processing. 5

Popular Programming Languages, Cont ’ d. Pascal — designed to teach structured programming; useful for math and science applications. 6

Popular Programming Languages, Cont ’ d. BASIC — an easy-to-learn beginner ’ s programming language. Visual Basic — an object-oriented, third-generation version of BASIC. 7

Popular Programming Languages, Cont ’ d. C, C++, C# — versions of the highly efficient C programming language; C++ and C# are object- oriented. 8

Popular Programming Languages, Cont ’ d. Java — object-oriented programming language commonly used for Web applications.  Platform independence — Java programs can run on any platform that supports the Java Virtual Machine. 9

Popular Programming Languages, Cont ’ d. Other high-level languages:  Ada  APL  LISP  Logo 11 PL/1 Prolog RPG SmallTalk

SQL – 4GL 12 Select address from Patients Where Patients.name = “Johnson” And Patients.age < 65

HIMA 4160 JavaScript

What is JavaScript Programming language designed for webpage To increase interactivity and dynamics Applications  Form validation  Shopping cart  Calculations  Special graphic and text effects  Online systems (Yahoo, Hotmail)  Online mapping (Google Map)  Online productivity suite (Google doc, ZOHO)

Before talking about JavaScript, we need to talk about form in HTML

HTML Form Explanation:

JavaScript Syntax Unlike HTML, JavaScript is case sensitive. Dot Syntax is used to combine terms.  e.g., document.write("Hello World") Certain characters and terms are reserved. JavaScript is simple text (ASCII).

JavaScript Terminology JavaScript programming uses specialized terminology. Understanding JavaScript terms is fundamental to understanding the script.  Objects, Properties, Methods, Events, Functions, Values, Variables, Expressions, Operators.

Objects Objects refers to windows, documents, images, tables, forms, buttons or links, etc. Objects should be named. Objects have properties that act as modifiers.

Properties Properties are object attributes. Object properties are defined by using the object's name, a period, and the property name.  e.g., background color is expressed by: document.bgcolor.  document is the object.  bgcolor is the property.

Methods Methods are actions applied to particular objects. Methods are what objects can do.  e.g., document.write(”Hello World")  document is the object.  write is the method.

Events Events associate an object with an action.  e.g., the onMouseover event handler action can change an image.  e.g., the onSubmit event handler sends a form. User actions trigger events.

Functions Functions are named statements that performs tasks.  e.g., function doWhatever () {statement here}  The curly braces contain the statements of the function. JavaScript has built-in functions, and you can write your own.

Values Values are bits of information. Values types and some examples include:  Number: 1, 2, 3, etc.  String: characters enclosed in quotes.  Boolean: true or false.  Object: image, form  Function: validate, doWhatever

Variables Variables contain values and use the equal sign to specify their value. Variables are created by declaration using the var command with or without an initial value state.  e.g. var month;  e.g. var month = “April”;

Expressions Expressions are commands that assign values to variables. Expressions always use an assignment operator, such as the equals sign.  e.g., var month = “May”; is an expression. Expressions end with a semicolon.

Operators Operators are used to handle variables. Types of operators with examples:  Arithmetic operators, such as plus.  Comparisons operators, such as equals.  Logical operators, such as and.  Control operators, such as if.  Assignment and String operators.

JavaScript Syntax: Dynamic Typing Idea  No need to declare variable type  A value is only checked from proper type when it is operated upon Example var x = 5; //int x = 5.5; //float x = “five point five” //String y=x/2 //wrong

Methods of Using JavaScript. 1. JavaScripts can reside in a separate page. 2. JavaScript can be embedded in HTML documents -- in the, in the, or in both. 3. JavaScript object attributes can be placed in HTML element tags. e.g.,

1. Using Separate JavaScript Files. Linking can be advantageous if many pages use the same script. Use the source element to link to the script file. <script src="myjavascript.js” language="JavaScript1.2” type="text/javascript">

2. Embedding JavaScript in HTML. When specifying a script only the tags and are essential, but complete specification is recommended: <script language="javascript” type="text/javascript"> <!-- Begin hiding window.location=”index.html" // End hiding script-->

Using Comment Tags HTML comment tags should bracket any script. The tags hide scripts in HTML and prevent scripts from displaying in browsers that do not interpret JavaScript. Double slashes // are the signal characters for a JavaScript single-line comment.

3. Using JavaScript in HTML Tags. Event handlers like onMouseover are a perfect example of an easy to add tag script. <a href=”index.html” onMouseover="document.logo.src='js2.gif'" onMouseout="document.logo.src='js.gif'">

Creating an Alert Message The following script in the tag uses the onLoad event to display an Alert window The message is specified within parenthesis.

Generating HTML Dynamically Idea  Script is interpreted as page is loaded, and uses document.write or document.writeln to insert HTML at the location the script occurs Template … Regular HTML <!-- Build HTML Here // --> More regular HTML

A Simple Script First JavaScript Page First Javascript Page <!-- document.write(“ ”); document.write(“Hello World Wide Web”); document.write(“ ”); //-->

Simple Script, Result

Monitoring User Events Use various onXxx attributes related to HTML tags  onClick  onLoad  onMouseOver  onFocus  …

User Events, Example Simple JavaScript Button <!-- function dontClick(){ alert(“I told you not to click!”); } //--> Simple JavaScript Button

User Events, Result

JavaScript Syntax: Function Declaration Declaration syntax  Functions are declared using the function reserved word  The return value is not declared, nor are the types of the arguments  Example: function square(x){ return(x*x); } function factorial(n){ if (n <= 0){ return(1); } else{ return (n * factorial(n-1)); }

Next Class Bring your laptop on Thursday.