Web Application Development Muhammad Ali Versonic Pte Asher Imtiaz Forman Christian College.

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

Intro to Javascript CS Client Side Scripting CS380 2.
Intro to JavaScript. JavaScript History Client (generally browser-side) language invented at Netscape under the name LiveScript around 1995 Netscape wanted.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 COMM 1213 H1 COMP 4923 X1 JavaScript 1 (Readings: Ch. 10, 11 Knuckles)
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
Tutorial 10 Programming with JavaScript
Information Technology Center Hany Abdelwahab Computer Specialist.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Taking JavaScript Seriously IS NOT THE WORST IDEA.
4.1 JavaScript Introduction
JavaScript: Control Structures September 27, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel,
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Scripting Languages.
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
CP476 Internet Computing JavaScript Client-Side Programming 1 1. What is JavaScript –Another script language for both client-side and sever-side programming.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
Web Application Development Muhammad Ali.  The Problem  Changing the Content of Page Dynamically  Efficient Utilization of Resources.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
SE-2840 Dr. Mark L. Hornick 1 Modifying webpage behavior using client-side scripting Javascript.
JavaScript davide morelli history LiveScript (1995) in Netscape java script is a misleading name started as a scripting counterpart.
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.
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
CHAPTER 4 Java Script อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Topic: An Introduction to JavaScript - from Beginning JavaScript by Wilton (WROX)
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
Lecture 9 The Basics of JavaScript Boriana Koleva Room: C54
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
4.4 JavaScript (JS) Deitel Ch. 7, 8, 9, JavaScript & Java: Similarities JS (JavaScript) is case-sensitive Operators –arithmetic: unary +, unary.
Basic Data Types Numbers (integer and floating point)‏ Strings (sequences of characters)‏ Boolean values (true/false)‏
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.
1 JavaScript
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
JS1-1 Introduction to JavaScript (JavaScript 1) Xingquan (Hill) Zhu
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 4 JavaScript.
Java Script About Java Script Document Object Model Incorporating JavaScript Adding JavaScript to HTML Embedding a Javascript External Scripts Javascript.
Pertemuan 5 IT133 Pengembangan Web JavaScript. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting.
“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
JavaScript and Ajax (JavaScript Data Types) Week 2 Web site:
JavaScript Katie Fowle November 15, History Brendan Eich at Netscape, 1995 Need for interactivity in web pages Mocha, LiveWire, LiveScript, then.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 4 – Simple Variable Types Modern JavaScript Design And Develop Copyright © 2012 by Larry.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
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.
JAVASCRIPT Dr Mohd Soperi Mohd Zahid Semester /16.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
PHP using MySQL Database for Web Development (part II)
>> Introduction to JavaScript
CHAPTER 10 JAVA SCRIPT.
Chapter 4 Client-Side Programming: the JavaScript Language
Basics of JavaScript Programming Language
JavaScript for C++ and Java Programmers
Week#2 Day#1 Java Script Course
14 A Brief Look at JavaScript and jQuery.
JavaScript an introduction.
T. Jumana Abu Shmais – AOU - Riyadh
JAVASCRIPT Pam Kahl | COM 585 | Spring 2010.
University of Kurdistan
Variables Kevin Harville.
Tutorial 10 Programming with JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

Web Application Development Muhammad Ali Versonic Pte Asher Imtiaz Forman Christian College

 The Problem  Changing the Content of Page Dynamically  Efficient Utilization of Resources

 The Solution  How?  Scripting Languages

 Interpreted Languages  Purpose  “Automate tasks within a particular software environment”  JavaScript  VBScript  JScript

 Case Sensitive  X != x  Few Snapshots from History  Developed by Brendan Eich (Netscape 2.0)  How the Name was Coined? ▪ LiveScript ▪ Renamed to JavaScript (Dec 1995 ) ▪ Marketing Tactics ▪ Similarity with Java (& C++)  Standardization Efforts ▪ ECMAScript

Communication XHTMLCSS JavaScript Flash Java Silverlight

Communication HTMLCSS JavaScript Flash Silverlight Java

Communication HTMLCSS JavaScript Flash Silverlight Java

Communication HTMLCSS JavaScript Flash Silverlight Java

Communication HTMLCSS JavaScript Flash Silverlight Java

 How to add JavaScript?  &  Inclusion Methods ▪ Same File (HTML File) ▪ External File (JS File) ~ Preferred Approach

alert("Hello World!");

alert("Hello World!"); Please enable JavaScript!

<!-- alert("Hello World!"); // --> Please enable JavaScript!

 alert  prompt  confirm

 Number  1  2.3  String  “a string”  Boolean  true  false

 Name it and Have it!  Use ‘var’ to declare variables!  Examples var num1 = 1; var num2 = 2.3; var str = “A String”; var anyVar; // undefined

 String Type  To append to strings var str1 = “abc”; var str2 = “def”; var strResult = str1 + str2;  What about var result = “1” + 2; And var result = “1” - 2; And var someVar ; // No initialization alert(someVar);

 Boolean Type  false ▪ false, undefined, null, 0, NaN, “” (empty string)  true ▪ Any other value is considered as true ▪ true, “abc”, 1, …

 alert(typeof (1));  number  alert(typeof(“abc”));  alert(typeof(“1”));  alert(typeof(true));

 parseInt  Converts a string to an integer number var integerNumber = parseInt(“12”);  parseFloat  Converts a string to a float number var floatNumber = parseFloat(“12.12”);  Converting a Number to a String?

 Loops  For Loop for (start; stop; step) { action } Example for (var i = 0 ; i < 10 ; ++i) { alert(i); }

 While Loop boolean someCondition = true; while (someCondition) { // Do something }

 Do-While Loop boolean someCondition = true; do { // Do something } while (someCondition);

Different forms  if (expr) { // Do something }

 if (expr) { // Do something } else { // Do something }

if (expr) { // Do something } else if (expr) { // Do something } else { // Do something }

switch (expr) { case value1: break; case value2: break; case valueN: break; default: break; } switch (grade) { case “A”: break; case “B”: break; case “C”: break; default: break; }

 Objects ▪ “An object in JavaScript is a set of properties, each of which consists of a unique name and a value belonging to one of JavaScript’s six data types” ▪ NO Classes in JavaScript! ▪ Class-Like features. var obj = new Object(); obj.Test = “Some Value”; alert(obj.Test); // Some Value delete obj.Test; alert(obj.Test); // undefined

 Enumerating Properties for (var aProperty in obj) { alert(aProperty + “ is a property of obj”); }  Displays Test is a property of obj

 Accessing Properties  obj[“Test”] = “someValue”; for (var aProperty in obj) { alert(aProperty + “ has value:” + obj[aProperty]); }

var str = new String(“This is a string”); var str = new String("abcdef"); var ch = str.charAt( 0 ); var index = str.indexOf("b", 0 ); if (index > 0 ) alert("Found at index: " + index); else alert("Not Found!");

 split(separater, limit)  toLowerCase()  toUpperCase()

 What’s an Array?  var ar1 = new Array();  var ar1 = new Array(5);  var ar2 = new Array(4, true, “OK”);  var ar3 = [4, true, “OK”];  var twoDimAr = [ [ “X”, “O”, “O”], [ “O”, “X”, “O”], [ “O”, “X”, “O”] ];

 Access an Element at Index ‘i’  ar[i] = 12;  alert(ar[3]);

 toString  splice  reverse  length  push

 Math  abs, ceil, floor, round, random, …  Trigonometric, logarithmic, etc  Date  Dates before January 1, 1970 are not supported

 What have we learnt today?  Need for client side programming  Why scripting languages?  JavaScript for client side programming  Language features of JavaScript