JavaScript.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Introducing JavaScript
1 COMM 1213 H1 COMP 4923 X1 JavaScript 1 (Readings: Ch. 10, 11 Knuckles)
The Web Warrior Guide to Web Design Technologies
1 HCI 201 JavaScript - Part 1. 2 Static web pages l Static pages: what we have worked with so far l HTML tags tell the browser what to do with the content.
Web Page Behavior IS 373—Web Standards Todd Will.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
The Information School of the University of Washington Oct 20fit programming1 Programming Basics INFO/CSE 100, Fall 2006 Fluency in Information Technology.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to scripting
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.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
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.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Tutorial 10 Programming with JavaScript
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
1 JavaScript
JavaScript Programming Unit #1: Introduction. What is Programming?
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part One.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
COMP403 Web Design JAVA SCRİPTS Tolgay KARANFİLLER.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
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.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Session 2 Basics of PHP.
Introduction to Client-Side Scripting and JavaScript
Chapter 6 JavaScript: Introduction to Scripting
“Under the hood”: Angry Birds Maze
Tutorial 10 Programming with JavaScript
JavaScript is a programming language designed for Web pages.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
The structure of computer programs
Chapter 19 JavaScript.
JavaScript an introduction.
Chapter 10 Programming Fundamentals with JavaScript
Introduction to JavaScript
INFO/CSE 100, Spring 2005 Fluency in Information Technology
T. Jumana Abu Shmais – AOU - Riyadh
JavaScript Defined General Syntax Body vs. Head Variables Math & Logic
INFO/CSE 100, Spring 2006 Fluency in Information Technology
CS105 Introduction to Computer Concepts
Midterm 2 review.
“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.
Javascript Chapter 19 and 20 5/3/2019.
Web Programming– UFCFB Lecture 13
CIS 136 Building Mobile Apps
CS105 Introduction to Computer Concepts JavaScript
Presentation transcript:

JavaScript

What is JavaScript JavaScript is the scripting language of the Web! JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more. JavaScript is the most popular scripting language on the internet.

What is JavaScript JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language A JavaScript consists of lines of executable computer code A JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Everyone can use JavaScript without purchasing a license

Are Java and JavaScript the Same? NO! Java and JavaScript are two completely different languages in both concept and design! Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++.

What can a JavaScript Do? JavaScript gives HTML designers a programming tool JavaScript can put dynamic text into an HTML page JavaScript can react to events JavaScript can read and write HTML elements JavaScript can be used to validate data JavaScript can be used to create cookies

How to Put a JavaScript Into an HTML Page <html> <body> <script type="text/javascript"> document.write("Hello World!") </script> </body> </html>

Where to Put the JavaScript JavaScripts in the body section will be executed WHILE the page loads. JavaScripts in the head section will be executed when CALLED.

VARIABLES

JavaScript Variables A variable is a "container" for information you want to store. A variable's value can change during the script. You can refer to a variable by name to see its value or to change its value. Represents a value stored in a memory

Numeric Variables Values that hold number

String Variables Values that hold words or combination of letters

Boolean Variables Represents a state or condition as being true or false

Rules for variable names: Variable names are case sensitive They must begin with a letter or the underscore character Do not place any space or punctuation in the name Avoid naming variables with reserved words Reserved words are predefined words that have special meaning to JavaScript

Examples of valid and invalid variable names idnumber Id number Cust_ID Cust.ID Major *Major Year2000 2000 _continue Continue

Declaring a variable Variables are declared the first time they are used by inserting the word var before the variable name, followed by an equal ( = ) sign

Declare a Variable You can create a variable with the var statement: var strname = some value You can also create a variable without the var statement: strname = some value

Lifetime of Variables When you declare a variable within a function, the variable can only be accessed within that function. When you exit the function, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different functions, because each is recognized only by the function in which it is declared. If you declare a variable outside a function, all the functions on your page can access it. The lifetime of these variables starts when they are declared, and ends when the page is closed.

Literals While a variable is used to store data or values, a literal is a constant value that does not change. A literal is an actual number or character text, rather than a calculated result or value from input from a keyboard. Numeric= number e.g var width=3 String = character or text value e.g var browsertype=“Netscape”

Expressions and Operators Is a formula or a way to assign values to variables Average=totalvalue/Count >>>shows an expression that might be used in simple math problems

Concatenation Used to join string literals or variables to get as one variable

Functions Is a way to write several lines of script and used them repeatedly as needed.

Conditional Statements In JavaScript we have the following conditional statements: if statement if...else statement if...else if....else statement switch statement