CS-3432 Electronic Commerce Lecture – 13 Sikandar Shujah Toor https://sites.google.com/site/uolcsecom.

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

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Chapter 4(b): Fundamentals of JavaScript
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
Java Planning our Programs Flowcharts Arithmetic Operators.
IM 215 Operators, Conditions and Loops. Review Nature of Javascript How to include Javascript on a page Declaring and assigning variables Commenting code.
JavaScript Friend or Foe?. History of Java and JavaScript Oak and Coffee? ECMAscript European Computer Manufacturers Association JScript?
CIS 234: Order of Operations, Shortcut & Other Operators Dr. Ralph D. Westfall February, 2004.
Javascript A primer based on Pascal. Javascript Technically called ECMAScript Most Javascript is used on web pages. NOT like Java. (But designed to look.
JavaScript Programming an Introduction Prepared By P.D. Krolak and M.S. Krolak Based on material from JavaScript Unleashed (2nd Ed)
Introduction to JavaScript for Python Programmers
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
Lesson 14.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
JavaScript Informatics for economists I. Introduction Programming language used in web pages. Simple and easy to use – written in HTML document. Client.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Expression.
Week 9 PHP Cookies and Session Introduction to JavaScript.
2440: 211 Interactive Web Programming Expressions & Operators.
Chapter 3: Data Types and Operators JavaScript - Introductory.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
CHAPTER 4 Java Script อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Introduction to JavaScript Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan. 1.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
ALBERT WAVERING BOBBY SENG. Week 4: JavaScript  Quiz  Announcements/questions.
Operators. Today’s Learning Goals … Understand the purpose of JavaScript operators Explore the mathematical operators Find out about the assignment operators.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Intro to JavaScript. Some simple examples Examples from our webpage Examples from Andrews webpage Today’s Example.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
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.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
JavaScript, Fourth Edition
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
ECA 225 Applied Interactive Programming ECA 225 Applied Online Programming control structures, events, objects.
Jaana Holvikivi 1 Introduction to Javascript Jaana Holvikivi Metropolia.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Pertemuan 5 IT133 Pengembangan Web JavaScript. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting.
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,
Tutorial 11 1 JavaScript Operators and Expressions.
This is our seminar JavaScript And DOM This is our seminar JavaScript And DOM.
JavaScript, Sixth Edition
JavaScript Wrap Up JavaScript is a versatile programming language … if you know it, you can learn others © 2004, Lawrence Snyder.
Repetition Looping. Types for while do..while for The for loop allows you to iterate through a variable for a specific range of values. You must supply.
JavaScript Tutorial. What is JavaScript JavaScript is the programming language of HTML and the Web Programming makes computers do what you want them to.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
>> Fundamental Concepts in PHP
>> Introduction to JavaScript
CHAPTER 10 JAVA SCRIPT.
Web Systems & Technologies
Javascript Example
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
JavaScript Syntax and Semantics
JavaScript.
Web Programming Language
JavaScript Part 2.
JavaScript: Control Statements II
JavaScript CS 4640 Programming Languages for Web Applications
Web Programming– UFCFB Lecture 13
Web Programming and Design
Web Programming and Design
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

CS-3432 Electronic Commerce Lecture – 13 Sikandar Shujah Toor

onmouseover & onmouseout Onmouseover event <IMG SRC=moon.jpg WIDTH=200 HEIGHT=100 BORDER=0 NAME=picture onmouseover="picture.src='moon.jpg';picture.width=500; picture.height=350" onmouseout="picture.src='leopard.jpg';picture.width=600; picture.height=450">

onmouseover & onmouseout

<A href=leopard.jpg onmouseover="picture.src='moon.jpg';picture.width=500; picture.height=300" onmouseout="picture.src='moon.jpg';picture.width=170; picture.height=50"> <IMG SRC=moon.jpg WIDTH=200 HEIGHT=100 BORDER=2 NAME=picture> Anchor

Operators in JavaScript + For addition of two numbers and concatenation of two strings - for subtraction of two numbers * for multiplication of two numbers / for division of two numbers % modulus (calculating the remainder) ++ increment in number -- decrement in number

Logical Operators && logical and || logical or ! logical not if(x<y&&x<z) { any statement } if(!false){ statement }

Comparison Operators == Equal != not equal < Less than <= less than equal > Greater than >= Greater than equal

Javascript Example alert("Thank you for visiting our web site!") Java Script Example

Writing on a Page example-writing on the page <!-- document.write("Hello! Thank you for visiting our site.") //-->

Writing on a Page

Functions Definition Function is a block of code which is executed when someone calls it Defined as follows function my1stfunction(arg1, arg2, arg3) { // some code } When called, variables and arguments must be in expected order

Displaying System Date function displayDate(){ document.getElementById(“systemdt”).innerHTML=Date(); } My First JavaScript This is a paragraph. Display Date

<!-- function Addit(){ var num1=document.Calform.fst.value; var num2=document.Calform.scnd.value; alert(parseFloat(num1)+parseFloat(num2)); } function minus(){ var num1=document.Calform.fst.value; var num2=document.Calform.scnd.value; alert(parseFloat(num1)-parseFloat(num2)); } //--> Add and Subtract Calculator 1st Number: 2nd Number: Simple Calculator

Simple Calculator – Add

Simple Calculator – Minus

Loops Loops executes a block of code repeatedly until a condition is met Following types of loops present in JS For loop for(intialization;condition;increment) {statements} While loop while(codition){statements} Do while loop do{statements}while(condition) Do-while loop executes at least once

For Loop Using the For Loop for(i=1;i<7;i++) document.write(" For Loop Example "+i+“ !! ");

For Loop Example

While Loop Using the While Loop <!-- var i = 1; while (i < 7){ document.write(" While Loop Example "+i+"!! "); ++i; } //-->

While Loop Example

Do-while Loop Using the While Loop <!-- var i = 1; do { document.write(" Do-While Loop Example "+i+"!! "); ++i; } while (i < 1); //--> Loop executed once although the condition is false from the beginning

Do-while Loop Example

Java Script Objects Everything in Java Script is an Object which is a combination of data, properties and methods Properties are the values associated with the object Methods are the actions which can be performed on the object New objects can be inherited with “new” key word person = new Object() Object Properties can be set / retrieved by using “.” after object name person.name=“Uzair”; Methods can be called by the same “.” after object name var name = persone.getName();

Some Predefined JS Objects Global Array String Math Date … etc.

Example of Math object Using the Math object Using the Math object <!-- document.write("Math.PI :" +Math.PI +" "); document.write("Math.LN2 :"+Math.LN2+" "); document.write("Math.sin(90) :"+Math.sin(90)+" "); document.write("Math.random() :"+Math.random()+" "); document.write("Math.pow(2,3) :"+Math.pow(2,3)+" "); document.write("Math.min(123,133): "+Math.min(123,133)+" "); //-->

Math Object Example

Array Object Using Arrays Using Arrays <!-- myArray=[0,1,2,3,4,5,6,7,8,9,10]; document.write("myArray: first element " +myArray[0]+" "); document.write("myArray.toString(): "+myArray.toString()+" "); document.write("myArray.join(':'): "+myArray.join(':')+" "); document.write("myArray.reverse(): "+myArray.reverse()+" "); document.write("myArray.sort(): "+myArray.sort()+" "); //-->

Array Object