JavaScript Luke Withrow Nathan Kempner. ! Why JavaScript? Why not? Most popular language on the web Dynamic client-side Web applications Simple, powerful.

Slides:



Advertisements
Similar presentations
The Web Wizards Guide To JavaScript Chapter 1 JavaScript Basics.
Advertisements

MWD1001 Website Production Using JavaScript with Forms.
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 William Hosbein L1k3 th3 c00l l00k1ng d3s1gn?
12-Jun-15 JavaScript Language Fundamentals I. 2 About JavaScript JavaScript is not Java, or even related to Java The original name for JavaScript was.
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
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
J avaScript J JP P resentation Jeff Watson Web & Internet Programming Group.
4.1 JavaScript Introduction
Introduction to JavaScript Kirkwood Continuing Education © Copyright 2014, Fred McClurg All Rights Reserved.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Introduction to JavaScript.
Introduction to JavaScript 11 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 14.
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Javascript Languages By Rapee kamoltalapisek ID:
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
JavaScript Tabriz university Its September 1995.
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)
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
JavaScript Justin Skinner Programming Languages. JavaScript JavaScript is not Java nor a subset But JavaScript does share the C-family syntax with Java.
Client-side processing in JavaScript.... JavaScript history Motivations –lack of “dynamic content” on web pages animations etc user-customised displays.
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
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.
Java Script About Java Script Document Object Model Incorporating JavaScript Adding JavaScript to HTML Embedding a Javascript External Scripts Javascript.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript & Introduction to AJAX
Java Script. introduction Today’s web sites need to go much beyond HTML. browsing through a web site, to actually interact with the web site. The web.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript Katie Fowle November 15, History Brendan Eich at Netscape, 1995 Need for interactivity in web pages Mocha, LiveWire, LiveScript, then.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
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 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
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
PHP using MySQL Database for Web Development (part II)
Top 8 Best Programming Languages To Learn
Types for Programs and Proofs
CS5220 Advanced Topics in Web Programming JavaScript and jQuery
JavaScript.
14 A Brief Look at JavaScript and jQuery.
Dynamic Web Pages JavaScript Jill Thomas Oct 14, 2003.
JavaScript Introduction
JavaScript an introduction.
Web Systems Development (CSC-215)
The Web Wizard’s Guide To JavaScript
DHTML Javascript Internet Technology.
DHTML Javascript Internet Technology.
PHP.
University of Kurdistan
Tutorial 10 Programming with JavaScript
Intro to PHP.
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
[Robert W. Sebesta, “Programming the World Wide Web
PHP an introduction.
Introduction To JavaScript
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

JavaScript Luke Withrow Nathan Kempner

! Why JavaScript? Why not? Most popular language on the web Dynamic client-side Web applications Simple, powerful core functionality

A Brief History of JavaScript Born in 1995 Full of security flaws Lack of development environments, debuggers, and meaningful error messages. “JavaScript has suffered for years at the hands of those who would criticize it for being too unlike Java, or too much like Perl, or too often used by well-meaning but otherwise ignorant web designers, shoehorned into pages without thought of future compatibility, intelligent abstraction, or code reuse.” -Steve Champeon

 A Slightly Less Brief History Accessibility for non-Java programmers Creator Brendan Eich Developed for the novice programmer Java vs. JavaScript Used to publish dynamic web content JavaScript became very popular very quickly Many programmers still considered it to be lacking Simple style and syntax further discredited it

Market The market for JavaScript is very specific. Javascript isn't used to write complex databases or operating systems. It is used to add simple enhancements to websites.

Object Oriented Scripting Object Oriented Event Driven Late Binding Interpreted by browser – Sometimes this causes problems

@ Data Types Numbers – Integers – Floats – Octals, Hexadecimals Strings Booleans Null & Undefined Objects (and Arrays) Loose data typing allows for flexibility and ease of use. Arrays aren’t a basic type; they’re pre- defined objects, like in Java or C++ $ #

Variables Naming conventions Global – Global variables are declared simply by assigning a value: x = 10; Local – Local variables are declared inside a function: var x; Undefined vs. Null-value X Y

{} Functions Variables, literals, and objects can be passed as arguments. The argument list is an array with the same name. Overloading is not implemented, but can be simulated. document.write(“Hello World!"); theDay = dateObject.getDate() ; JavaScript can be polymorphic.

Flow Control If…else While Do-while For Return Break Switch  

Document Object Model

Netscape vs. IE “Many designers simply checked for Navigator in their scripts and ignored IE as a lost cause, just as early CGI programmers checked for "Mozilla" in the user agent environment variable, leading to the ridiculous convention, still followed today, whereby practically all of the major browsers announce themselves as "Mozilla" first, then "(compatible; BrowserName)" second. In short, JavaScript took on a not-entirely-deserved reputation for being yet another roadblock to a truly cross-platform standards-driven Web.”

ECMAScript: An Attempt at Standardization Lack of standards for JavaScript Discrepancies between IE and Netscape ECMAScript was an attempt at standardization It failed: Both browsers continued to develop their own DOMs and DHTML support

Fiefdoms of Functionality Problems with cross- browser support Different libraries were produced for each browser This only served to widen the gap New tools had to be developed to resolve these problems

Efficiency It's not compiled, it's interpreted. Because of this, it tends to be fairly slow. And because the tokens are generally fairly large, it is slower to interpret than some other scripting languages (like Perl).

Usability Dependent on DOM Source code difficult to hide Still lacks good debugger, IDE, and standardized development tools Still very popular, compared to the alternatives

Some Sample Code on (release) { setProperty ("Monster", _xscale, getProperty("Monster", _xscale)/1.1); setProperty ("Monster", _yscale, getProperty("Monster", _yscale)/1.1); worshipColor = new Color(Monster.sprite); worshipColorTransform = new Object(); worshipColorTransform.ra = worshipColor.getTransform().ra- 10; … worshipColorTransform.aa = 100; worshipColorTransform.ab = 100; worshipColor.setTransform(worshipColorTransform); if (getProperty("Monster", _yscale)<20) { gotoAndStop ("Scene1", "Squiggly"); }

Applications