Client-Side Web Programming. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University
|
|
- Wilfrid Doyle
- 5 years ago
- Views:
Transcription
1 Client-Side Web Programming Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University 1
2 Objectives You will learn about: Client-side web programming, alias programming the browser, via JavaScript AJAX JavaScript libraries 2
3 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 3
4 Why JavaScript? Question: Why study JavaScript? Answer: TIOBE index of language popularity: Java, C, C++, C#, Python, JavaScript, PHP, 4
5 Why JavaScript? Website Front End Back End Google.com JavaScript C, C++, Go, Java, Python Facebook.com JavaScript Hack, PHP, Python, C++, Java, Erlang, D, Xhp, Haskell YouTube.com JavaScript C, C++, Java, Python, Go Yahoo JavaScript PHP Amazon.com JavaScript Java, C++, Perl Wikipedia.org JavaScript PHP, Hack Twitter.com JavaScript C++, Java, Scala, Ruby Bing JavaScript ASP.net ebay.com JavaScript Java, JavaScript, Scala MSN.com JavaScript ASP.net h"ps://en.wikipedia.org/wiki/ Programming_languages_used_in_most_popular_websites 5
6 JavaScript Who: Brendan Eich Where: Netscape When: 1995 Why: Client-side scripting language for web pages 6
7 JavaScript Overview Client-side scripting language Embedded into HTML code Interpreted by Netscape browser, then all popular browsers Usage: <script> JavaScriptCode </script> <script src="url"></script> <sometag onsomeevent ="JavaScriptCode"> 7
8 JavaScript vs. Java JavaScript vs. Java JavaScript was originally LiveScript Later changed to JavaScript to capitalize on popularity of Java JavaScript is related to Java only superficially 8
9 The JavaScript Language Yet another programming language!!! No time to cover thoroughly See my personal Subset of JavaScript Link on course website Some simple examples that might help... 9
10 JavaScript Examples See hello1.html The <script> tag See hello2.html Weak convention: Place function definitions in <head> </head> Functions and function calls 10
11 JavaScript Examples See hello3.html Event handling avoids global code See helloerror.html Error reporting In Firefox Error Console (Tools Web Developer Browser Console) In Chrome More tools Developer Tools 11
12 JavaScript Examples See square.html Arguments and parameters Call is by value See squareroot.html Standard Math object 12
13 JavaScript Examples See circle.html (Unusual) use of prompt() Local variables Data types Type conversions 13
14 JavaScript Data Types JavaScript data types Integer 1, 12345, 01, , 0x1, 0x1DB5 Floating point 0.0, 1,23, 1.23e4 String 'hi', "hi" Boolean: true, false Null object null 14
15 JavaScript Examples See euclid.html Control statements: if, while 15
16 JavaScript Statements JavaScript statements var Compound if..else switch while do while for try catch throw break continue Function definition Function call 16
17 JavaScript Examples See intmath.js and testintmath.html Multi-file programs <script src="someurl"> 17
18 JavaScript Examples See datastructures.html Artificial Arrays Associative arrays 18
19 JavaScript Examples See testdivmod1.html Arrays See testdivmod2.html Associative arrays Keys need not be literals; can be names! Can access values using object field selector notation! 19
20 JavaScript Assoc Arrays To create and use an associative array: someassocarray = {"somekey": 18}; someassocarray["somekey"] someassocarray.somekey Can use an assoc array as if it were an object To create and use an object: someobject = {someproperty: 18}; someobject.someproperty someobject["someproperty"] Can use an object as if it were an assoc array 20
21 JavaScript Objects In JavaScript Any associative array is an object Any object is an associative array!!! Or, if you prefer JavaScript has no associative arrays An object can serve the purpose of an associative array 21
22 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 22
23 Objects Create an object var shape1 = {x:1, y:2} shape1.x shape1.y shape1["x"] shape1["y"] var shape1 = {} shape1.x = 1; shape1.y = 2; shape1.x shape1.y shape1["x"] shape1["y"] 23
24 Objects Create an object containing functions var shape1 = { x: 1, y: 2, display: function() { document.write(string(this.x) + ", " + String(this.y)); } } shape1.x shape1.display() this inside of the function def refers to the containing object 24
25 Creating Objects Create an object using an ordinary function function createshape(x, y) { var shape = {x: x, y: y}; shape.display = function() { document.write(string(this.x) + ", " + String(this.y)); } return shape; } var shape1 = createshape(1, 2); shape1.x shape1.display() 25
26 Creating Objects Create an object using a constructor and new function Shape(x, y) { this.x = x; this.y = y; this.display = function() { document.write(string(this.x) + ", " + String(this.y)); } } var shape1 = new Shape(1, 2); shape1.x shape1.display() A constructor is a function that is called via new Calling a constructor instantiates a new object this inside of the constructor refers to the new object 26
27 Creating Objects Create an object using the Object() constructor var shape1 = new Object(); shape1.x = 1; shape1.y = 2; shape1.display = function() { document.write(string(this.x) + ", " + String(this.y)); } shape1.x shape1.display() Unusual 27
28 Creating Objects Summary so far How to create an object: Literally Using a function Using a constructor Using Object() 28
29 Object Example See fraction1.js and testfraction1.html No private properties Use underscores to suggest privacy??? Each object has its own copy of each property Including methods! Other points of note: Cannot include one Javascript file into another! Implicit calls of tostring() method 29
30 Prototypes Prototype: An object to which other objects delegate Each object points/delegates to the prototype of its constructor 30
31 Prototypes Example Create a prototype: function Shape(x, y) { this.x = x; this.y = y; } Shape.prototype.display = function() { document.write(string(this.x) + ", " + String(this.y)); } var shape1 = new Shape(1, 2); shape1.x shape1.display() 31
32 Prototypes Reference a property p of shape1: Use p defined in shape1, or Use p defined in prototype of Shape 32
33 Prototypes Example See fraction2.js and testfraction2.html Each object created via Fraction constructor has its own copy of _num and _den All objects created via Fraction share methods defined in prototype of Fraction More space-efficient 33
34 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 34
35 JavaScript DOM Document Object Model (DOM) A programmatic model of the HTML document in which the JavaScript code appears Each HTML element and attribute is represented as an object Objects are arranged in a containment tree window -> document -> element -> attribute Standardized by World Wide Web Consortium (W3C) Some (old) browsers don't observe 35
36 DOM Details window object Represents the browser window Important property: document document object Represents the current document Contains references to element objects Important methods: write(), getelementbyid() 36
37 DOM Details element objects Each represents an HTML element (<body>, <p>, ) Each contains references to objects representing its attributes Each contains references to objects representing its children 37
38 DOM Example See printdomtree.html Recursively traverses DOM tree Prints DOM tree of current document 38
39 JavaScript Events Event An occurrence on a particular element Event handler JavaScript code Installed on a particular element for a particular event When event occurs on that particular element, event handler is executed 39
40 Installing Event Handlers Attributes for installing mouse event handlers onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, Attributes for installing keyboard event handlers onkeydown, onkeypress, onkeyup Attributes for installing frame/object event handlers onload, onresize, Attributes for installing form event handlers onblur, onfocus, onreset, onselect, onsubmit, 40
41 Events Example See events.html Ways to reference an object within the DOM Event handlers on <body> element Event handlers on <form> element Event handlers on <input> element 41
42 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 42
43 PennyJavaScript App Problem: In Penny apps, missing author name is an error In principle, browser could: Detect missing author name Warn user w/o contacting server And thereby: Provide user feedback more quickly Reduce server load 43
44 PennyJavaScript App Problem: In Penny apps, header morning/afternoon is computed once on server-side Better to compute it continuously on clientside Problem: In Penny apps, footer, current date/time is computed once on server-side Better to compute it continuously on clientside 44
45 PennyJavaScript App Solution: Program the browser 45
46 PennyJavaScript App See PennyJavaScript app runserver, runserver.bat, book.py, database.py header.tpl footer.tpl index.tpl searchform.tpl searchresults.tpl penny.py Some notes... 46
47 PennyJavaScript App penny.py Server side is composed using Python Bottle Could have used Python CGI, Java Servlets, Java Spark, PHP, Still must validate form data!!! User might browse to searchresults page directly 47
48 PennyJavaScript App header.tpl JavaScript code causes browser to compute morning/afternoon repeatedly footer.tpl JavaScript code causes browser to compute current date/time repeatedly 48
49 PennyJavaScript App searchform.tpl JavaScript code calls date-time functions when page is loaded JavaScript code validates author upon form submission searchresults.tpl JavaScript code calls date-time functions when page is loaded 49
50 JavaScript Versions Year Name Description 1997 ECMAScript1 First edition ECMAScript2 Editorial changes only ECMAScript3 Added regular expressions Added try/catch. ECMAScript4 Was never released ECMAScript5 Added strict mode. Added JSON support ECMAScript5.1 Editorial changes ECMAScript6 Added classes and modules ECMAScript7 Added exponentiation operator (**). Added Array.prototype.includes. 50
51 JavaScript Summary JavaScript language summary C/Java-like syntax Weakly typed Unusual object model Objects are associative arrays 51
52 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 52
53 Preliminary Note Each Penny app can be expressed as a single page... 53
54 PennyBottleSingle App See PennyBottleSingle application runserver, runserver.bat, book.py, database.py, header.tpl, footer.tpl search.tpl penny.py 54
55 PennySparkSingle App See PennySparkSingle application Similar (Handouts not provided) 55
56 PennyPhpSingle App See PennyPhpSingle application Similar (Handouts not provided) 56
57 Single Page App Assessment Cons: In the context of this course... Maybe less understandable to programmer Doesn t illustrate state handling Doesn t illustrate A&A as well Pro: In the broader context... User might prefer 57
58 AJAX AJAX: Asynchronous JavaScript and XML Let s consider each part of the title... 58
59 AJAX JavaScript AJAX is accomplished via function calls embedded in JavaScript code 59
60 AJAX Asynchronous JavaScript code registers callback function Browser sends request to HTTP server Browser can do other work Callback from HTTP server alerts browser that response is available 60
61 AJAX XML Data communicated from server to callback function can be (but need not be) an XML doc (AJA X is a misnomer) We ll cover XML soon 61
62 PennyAjax App Wouldn t it be nice if... Penny application could refresh book list with each user keystroke User need not click Submit button (Recall Google search page) 62
63 PennyAjax App See PennyAjax app runserver, runserver.bat, book.py, database.py, header.tpl, footer.tpl search.tpl penny.py Some notes... 63
64 PennyAjax App penny.py Server side is composed using Python Bottle Could have used Python CGI, Java Servlets, Java Spark, PHP, search() Instantiates and returns search.tpl searchresults() Returns book list as plain text 64
65 PennyAjax App search.tpl Contains AJAX code Note code to handle differences among browsers searchresults() Generates reply as a HTML fragment 65
66 PennyAjax App Question: Why abort previous request? Answer: We re interested in the response for only the most recent request 66
67 PennyAjax App Question: Why send messageid? Answer: Make sure that each GET request is unique Otherwise browser may use cached page instead of sending HTTP request 67
68 Agenda 1. JavaScript fundamentals 2. JavaScript OOP 3. JavaScript DOM and events 4. JavaScript for client-side web pgmming 5. AJAX 6. JavaScript libraries 68
69 Motivation for JavaScript Libraries Problem 1: Many incompatibilities among (old) browsers DOM may vary JavaScript may vary! (HTML may vary!!) JavaScript code should account for all/most/ many variations Problem 2: JavaScript/AJAX code uses common patterns and often is repetitive 69
70 JavaScript Libraries Solutions: Keep it simple Use a JavaScript generator Google Web Toolkit, Use a JavaScript library jquery, Use a JavaScript framework AngularJS, React, 70
71 Who: John Resig When: 2006 Why: Simplify JavaScript syntax for finding, selecting, and manipulating DOM elements jquery 71
72 Why jquery? Rank JavaScript Technology Websites 1 jquery 70,000,000 2 jqueryui 10,778,380 3 Bootstrap 7,710,384 4 Modernizr 3,846,285 5 Google Tag Manager 3,432,375 6 Errorception 3,115,600 7 LightBox 2,248,632 8 htmp5siv 1,883,236 9 Backbone.js 985, AngularJS 547, React 114,826 According to on 11/12/17 72
73 jquery Fundamentals jquery syntax: $(selector).action() $: indicates access of jquery selector: selects HTML element(s) As in CSS action(): specifies an action to be performed on the selected element(s) 73
74 PennyJQuery App See PennyJQuery app runserver, runserver.bat book.py, database.py, penny.py header.tpl footer.tpl search.tpl Generalizing... 74
75 PennyJQuery App jquery makes it easier to access DOM Without jquery: var author = document.getelementbyid('authorinput').value; With jquery: var author = $('#authorinput').val(); # => access by id 75
76 PennyJQuery App jquery separates event handling code from HTML (example 1) Without jquery (in search.tpl): <body onload= "getampm(); getdatetime(); "> </body> 76
77 PennyJQuery App With jquery (in search.tpl): <body> </body> With jquery (in header.tpl): <script> $('document').ready(getampm); </script> With jquery (in footer.tpl): <script> $('document').ready(getdatetime); </script> 77
78 PennyJQuery App Without jquery (in search.tpl): <body onload= " document.getelementbyid('authorinput').focus()"> </body> With jquery (in search.tpl): <body> </body> <script> function setup() { $('#authorinput').focus(); } $('document').ready(setup); </script> 78
79 PennyJQuery App jquery separates event handling code from HTML (example 2) Without jquery (in search.tpl): <input type="text" id="authorinput" onkeyup="getresults()"> With jquery (in search.tpl): <input type="text" id="authorinput"> <script> $('#authorinput').keyup(getresults); </script> 79
80 PennyJQuery App jquery makes it easier to program AJAX Without jquery (in search.tpl): function createajaxrequest() {... return req; } function processreadystatechange() {... var resultsparagraph = document.getelementbyid("resultsparagraph"); resultsparagraph.innerhtml = this.responsetext; } function getresults() {... request = createajaxrequest(); request.onreadystatechange = processreadystatechange; request.open("get", url); request.send(null); } 80
81 PennyJQuery App With jquery (in search.tpl): function handleresponse(response) { $('#resultsparagraph').html(results); } function getresults() {... request = $.ajax( { type: "GET", url: url, success: handleresponse } ); } 81
82 AngularJS Who: Miško Hevery When: 2009 Where: Google (but not originally) Why: Address many problems in developing one-page apps 82
83 Why AngularJS? According to h"ps://ho<rameworks.com/ on 6/21/17 Stack Github Overflow Overall Score Score Score ASP.NET (C#) AngularJS (Javascript) Ruby on Rails (Ruby) ASP.NET MVC (C#) React (JavaScript) Django (Python) Laravel (PHP) Angular (JavaScript) Spring (Java) Express (JavaScript) Meteor (JavaScript) CodeIgniter (PHP) Symfony (PHP) Vue.js (JavaScript) Flask (Python) Note: Angular is a complete rewrite of AngularJS 83
84 AngularJS Fundamentals AngularJS Extends HTML with ng- attributes ng-app: defines an AngularJS application ng-model: binds the value of an HTML element (input, textarea, ) to a property of the scope object ng-bind: binds a property of the scope object to an HTML element 84
85 PennyAngular App See PennyAngularJs app runserver, runserver.bat, book.py, database.py header.tpl, footer.tpl, penny.py search.tpl 85
86 PennyAngularJs App search.tpl Controller function Uses values from scope (and thereby from HTML input elements) Assigns values to scope (and thereby to HTML elements) Handles AJAX Generalizing... 86
87 PennyAngularJs App AngularJS encourages MVC architecture on the client side! Model The scope object and its contents View The HTML code Controller The controller object and its function 87
88 React Who: Jordan Walke When: 2011 Where: Facebook Why: Handle user interfaces in web apps 88
89 Why React? According to h"ps://ho<rameworks.com/ on 6/21/17 Stack Github Overflow Overall Score Score Score ASP.NET (C#) AngularJS (Javascript) Ruby on Rails (Ruby) ASP.NET MVC (C#) React (JavaScript) Django (Python) Laravel (PHP) Angular (JavaScript) Spring (Java) Express (JavaScript) Meteor (JavaScript) CodeIgniter (PHP) Symfony (PHP) Vue.js (JavaScript) Flask (Python)
90 PennyReact App Thanks to Lucas Manning See PennyReact app runserver, runserver.bat book.py, database.py search.tpl, penny.py main.js PennyHeader,jsx, PennyFooter.jsx PennySearch.jsx package.json, webpack.config.js 90
91 PennyReact App book.py New method: serialize() Not necessary, but makes penny.py cleaner database.py Same as usual 91
92 PennyReact App search.tpl Python Bottle template Note div element with id root Note fetch of script /static/app.bundle.js Created by WebPack Contains all HTML/JavaScript code 92
93 PennyReact App penny.py Delivers files from /static Specifically, app.bundle.js search() instantiates search.tpl searchresults() generates books in JSON 93
94 PennyReact App main.js In the bundle Defines HTML to be assigned into element whose id is root New versions of JavaScript have import statement New HTML elements!? PennyHeader, PennySearch, PennyFooter 94
95 PennyReact App PennyHeader.jsx, PennyFooter.jsx In the bundle Use JSX A JavaScript extension syntax Allows using HTML tag syntax to render components Define the <PennyHeader> and <PennyFooter> elements Define HTML to be included into main.js 95
96 PennyReact App PennySearch.jsx In the bundle Uses JSX Defines the <PennySearch> element Defines HTML to be included into main.js Issues AJAX request Receives AJAX response 96
97 PennyReact App webpack.config.js Tells WebPack: To create static/app.bundle.js That the bundle should contain main.js (which contains *.jsx) package.json Controls the build process Build process uses 97
98 Node.js Who: Ryan Dahl When: 2009 Why: Allow JavaScript to be used for server-side scripting 98
99 Node.js Node.js JavaScript runtime Based upon Google s V8 JavaScript engine Allows running JavaScript on server-side Can behave as a HTTP server Provides tools to help with development of React client-side PennyReact uses Node.js only in that capacity 99
100 Summary We have covered: Client-side web programming, alias programming the browser via JavaScript AJAX JavaScript libraries The jquery library The AngularJS framework The React framework 100
101 Appendix 1: JavaScript Delegation 101
102 Inheritance Example Shape x y move() display() Square length display() Circle radius display() 102
103 Inheritance in Java See Shapes.java Specified via extends Missing extends => class inherits from Object 103
104 Inheritance in Python See shapes.py Specified via superclass name in parens Missing => class inherits from object 104
105 JavaScript Prototypes Previous example: function Shape(x, y) { this.x = x; this.y = y; } Shape.prototype.display = function() { document.write(string(this.x) + ", " + String(this.y)); } var shape1 = new Shape(1, 2); shape1.x shape1.display() Reference a property p of shape1 Use p defined in shape1, or Use p defined in prototype of Shape 105
106 JavaScript Prototype Chains There s more Each prototype points/delegates to the prototype of some other constructor Except for the prototype of Object, whose pointer is null Thus prototypes form a prototype chain 106
107 JavaScript Prototype Chains Reference a property p of shape1 Use p defined in shape1, or Use p defined in prototype of Shape, or Use p defined in prototype of Object, or Fail JavaScript resolves property references via delegation to prototypes 107
108 Prototype Chains Example See shapes.html JavaScript doesn t implement inheritance Use delegation instead 108
109 Prototype Chains Example Note: Call Object.create() to create a prototype chain function Square { } // Square has a prototype. // The prototype delegates to Object's prototype. Square.prototype = Object.create(Shape.prototype); // Create a new object that has Shape's prototype as // its prototype. Set Square.prototype to reference // that object. Square.prototype.constructor = Square; // Square's prototype has Shape is its constructor. // That's wrong; change Square's prototype to Square. Square.prototype.display = // Add properties to Square's prototype. 109
110 Prototype Chains Example Note: Call square1.display() Use display() defined in square1? No. Use display() defined in prototype of Square? Yes. Call square1.move() Use move() defined in square1? No. Use move() defined in prototype of Square? No. Use move() defined in prototype of Shape? Yes. 110
111 Appendix 2: Java Applets 111
112 Java Applets Java Applets Another client-side web programming technology 112
113 Java Applets vs. JavaScript Applet pros: Uses JVM Completely portable across (supporting) browsers (Arguably) more powerful Java lang & libraries are more powerful than JavaScript lang & libraries (But third-party JavaScript libraries add much power) 113
114 Java Applets vs. JavaScript JavaScript pros: Simpler Run directly by browser, not via JVM Launches faster Better integrated into browser (e.g. resizing) 114
115 Java Applets Popularity Early days of Java: Applets were the motivating force Applications were secondary Now Applets are much less popular See 8q8n3k/a-brief-history-of-the-java-applet We will not cover I have Penny app using Applets; see me if you want 115
Server-Side Web Programming: Python (Part 2) Copyright 2017 by Robert M. Dondero, Ph.D Princeton University
Server-Side Web Programming: Python (Part 2) Copyright 2017 by Robert M. Dondero, Ph.D Princeton University 1 Objectives You will learn about: Python WSGI programming Web app frameworks in general (briefly)
More informationPrinceton University COS 333: Advanced Programming Techniques A Subset of JavaScript
Princeton University COS 333: Advanced Programming Techniques A Subset of JavaScript Program Structure function sqr(i) var result; // Otherwise result would be global. result = i * i; //
More informationLECTURE-3. Exceptions JS Events. CS3101: Programming Languages: Javascript Ramana Isukapalli
LECTURE-3 Exceptions JS Events 1 EXCEPTIONS Syntax and usage Similar to Java/C++ exception handling try { // your code here catch (excptn) { // handle error // optional throw 2 EXCEPTIONS EXAMPLE
More informationCISH-6510 Web Application Design and Development. Overview of JavaScript. Overview
CISH-6510 Web Application Design and Development Overview of JavaScript Overview What is JavaScript? History Uses of JavaScript Location of Code Simple Alert Example Events Events Example Color Example
More informationKey features. Nothing to do with java It is the Client-side scripting language Designed to add interactivity to HTML pages
Javascript Key features Nothing to do with java It is the Client-side scripting language Designed to add interactivity to HTML pages (DHTML): Event-driven programming model AJAX Great example: Google Maps
More informationPrinceton University COS 333: Advanced Programming Techniques A Subset of JavaScript
Princeton University COS 333: Advanced Programming Techniques A Subset of JavaScript Program Structure function sqr(i) var result; // Otherwise result would be global. result = i * i; //
More informationNew Perspectives on Creating Web Pages with HTML. Tutorial Objectives
New Perspectives on Creating Web Pages with HTML Tutorial 9: Working with JavaScript Objects and Events 1 Tutorial Objectives Learn about form validation Study the object-based nature of the JavaScript
More informationCSC Javascript
CSC 4800 Javascript See book! Javascript Syntax How to embed javascript between from an external file In an event handler URL - bookmarklet
More informationThis course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.
HTML5/CSS3/JavaScript Programming Course Summary Description This class is designed for students that have experience with basic HTML concepts that wish to learn about HTML Version 5, Cascading Style Sheets
More informationFundamentals of Website Development
Fundamentals of Website Development CSC 2320, Fall 2015 The Department of Computer Science Events handler Element with attribute onclick. Onclick with call function Function defined in your script or library.
More informationJAVASCRIPT BASICS. Handling Events In JavaScript. In programing, event-driven programming could be a programming
Handling s In JavaScript In programing, event-driven programming could be a programming paradigm during which the flow of the program is set by events like user actions (mouse clicks, key presses), sensor
More information710 Index Attributes, 127 action attribute, 263 assigning, bottom attribute, domain name attribute, 481 expiration date attribute, 480 8
INDEX Symbols = (assignment operator), 56 \ (backslash), 33 \b (backspace), 33 \" (double quotation mark), 32 \e (escape), 33 \f (form feed), 33
More informationQiufeng Zhu Advanced User Interface Spring 2017
Qiufeng Zhu Advanced User Interface Spring 2017 Brief history of the Web Topics: HTML 5 JavaScript Libraries and frameworks 3D Web Application: WebGL Brief History Phase 1 Pages, formstructured documents
More informationEvents: another simple example
Internet t Software Technologies Dynamic HTML part two IMCNE A.A. 2008/09 Gabriele Cecchetti Events: another simple example Every element on a web page has certain events which can trigger JavaScript functions.
More informationFront End Programming
Front End Programming Mendel Rosenblum Brief history of Web Applications Initially: static HTML files only. Common Gateway Interface (CGI) Certain URLs map to executable programs that generate web page
More information5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web
Objectives JavaScript, Sixth Edition Chapter 1 Introduction to JavaScript When you complete this chapter, you will be able to: Explain the history of the World Wide Web Describe the difference between
More informationJavaScript and XHTML. Prof. D. Krupesha, PESIT, Bangalore
JavaScript and XHTML Prof. D. Krupesha, PESIT, Bangalore Why is JavaScript Important? It is simple and lots of scripts available in public domain and easy to use. It is used for client-side scripting.
More informationServer-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University
Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University 1 Objectives You will learn about Server-side web programming in Python Common Gateway Interface
More informationJavaScript Specialist v2.0 Exam 1D0-735
JavaScript Specialist v2.0 Exam 1D0-735 Domain 1: Essential JavaScript Principles and Practices 1.1: Identify characteristics of JavaScript and common programming practices. 1.1.1: List key JavaScript
More informationThe course is supplemented by numerous hands-on labs that help attendees reinforce their theoretical knowledge of the learned material.
Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc WA2442 Introduction to JavaScript Objectives This intensive training course
More informationComprehensive AngularJS Programming (5 Days)
www.peaklearningllc.com S103 Comprehensive AngularJS Programming (5 Days) The AngularJS framework augments applications with the "model-view-controller" pattern which makes applications easier to develop
More informationLECTURE-2. Functions review HTML Forms. Arrays Exceptions Events. CS3101: Scripting Languages: Javascript Ramana Isukapalli
LECTURE-2 Functions review HTML Forms Arrays Exceptions Events 1 JAVASCRIPT FUNCTIONS, REVIEW Syntax function (params) { // code Note: Parameters do NOT have variable type. 1. Recall: Function
More informationProgramming the World Wide Web by Robert W. Sebesta
Programming the World Wide Web by Robert W. Sebesta Tired Of Rpg/400, Jcl And The Like? Heres A Ticket Out Programming the World Wide Web by Robert Sebesta provides students with a comprehensive introduction
More informationWant to add cool effects like rollovers and pop-up windows?
Chapter 10 Adding Interactivity with Behaviors In This Chapter Adding behaviors to your Web page Creating image rollovers Using the Swap Image behavior Launching a new browser window Editing your behaviors
More informationJavaScript Handling Events Page 1
JavaScript Handling Events Page 1 1 2 3 4 5 6 7 8 Handling Events JavaScript JavaScript Events (Page 1) An HTML event is something interesting that happens to an HTML element Can include: Web document
More informationJAVASCRIPT FOR PROGRAMMERS
JAVASCRIPT FOR PROGRAMMERS DEITEL DEVELOPER SERIES Paul J. Deitel Deitel & Associates, Inc. Harvey M. Deitel Deitel & Associates, Inc. PRENTICE HALL Upper Saddle River, NJ Boston Indianapolis San Francisco
More informationa Very Short Introduction to AngularJS
a Very Short Introduction to AngularJS Lecture 11 CGS 3066 Fall 2016 November 8, 2016 Frameworks Advanced JavaScript programming (especially the complex handling of browser differences), can often be very
More informationStandard 1 The student will author web pages using the HyperText Markup Language (HTML)
I. Course Title Web Application Development II. Course Description Students develop software solutions by building web apps. Technologies may include a back-end SQL database, web programming in PHP and/or
More informationPearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE England and Associated Companies throughout the world
Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE England and Associated Companies throughout the world Visit us on the World Wide Web at: www.pearsoned.co.uk Pearson Education Limited 2014
More informationPhoto from DOM
Photo from http://www.flickr.com/photos/emraya/2861149369/ DOM 2 DOM When a browser reads an HTML file, it must interpret the file and render it onscreen. This process is sophisticated. Fetch Parse Flow
More informationWeb Development. HCID 520 User Interface Software & Technology
Web Development! HCID 520 User Interface Software & Technology Web Browser Timeline 1993: NCSA Mosaic web browser First broadly adopted graphical browser URL bar, back/forward buttons, images, etc Creators
More informationUI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML
UI Course (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) HTML: Introduction The World Wide Web (WWW) and history of HTML Hypertext and Hypertext Markup Language Why HTML Prerequisites Objective
More informationwelcome to BOILERCAMP HOW TO WEB DEV
welcome to BOILERCAMP HOW TO WEB DEV Introduction / Project Overview The Plan Personal Website/Blog Schedule Introduction / Project Overview HTML / CSS Client-side JavaScript Lunch Node.js / Express.js
More information8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) What is JavaScript?
Web Development & Design Foundations with HTML5 Ninth Edition Chapter 14 A Brief Look at JavaScript and jquery Slides in this presentation contain hyperlinks. JAWS users should be able to get a list of
More informationJavaScript CS 4640 Programming Languages for Web Applications
JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation
More informationCS312: Programming Languages. Lecture 21: JavaScript
CS312: Programming Languages Lecture 21: JavaScript Thomas Dillig Thomas Dillig, CS312: Programming Languages Lecture 21: JavaScript 1/25 Why Discuss JavaScript? JavaScript is very widely used and growing
More informationWeb Development for Dinosaurs An Introduction to Modern Web Development
Web Development for Dinosaurs An Introduction to Modern Web Development 1 / 53 Who Am I? John Cleaver Development Team Lead at Factivity, Inc. An Introduction to Modern Web Development - PUG Challenge
More informationSections and Articles
Advanced PHP Framework Codeigniter Modules HTML Topics Introduction to HTML5 Laying out a Page with HTML5 Page Structure- New HTML5 Structural Tags- Page Simplification HTML5 - How We Got Here 1.The Problems
More informationWhy Discuss JavaScript? CS312: Programming Languages. Lecture 21: JavaScript. JavaScript Target. What s a Scripting Language?
Why Discuss JavaScript? CS312: Programming Languages Lecture 21: JavaScript Thomas Dillig JavaScript is very widely used and growing Any AJAX application heavily relies on JavaScript JavaScript also has
More informationSuch JavaScript Very Wow
Such JavaScript Very Wow Lecture 9 CGS 3066 Fall 2016 October 20, 2016 JavaScript Numbers JavaScript numbers can be written with, or without decimals. Extra large or extra small numbers can be written
More informationLecture 8 (7.5?): Javascript
Lecture 8 (7.5?): Javascript Dynamic web interfaces forms are a limited interface
More informationCS Final Exam Review Suggestions - Spring 2018
CS 328 - Final Exam Review Suggestions p. 1 CS 328 - Final Exam Review Suggestions - Spring 2018 last modified: 2018-05-03 Based on suggestions from Prof. Deb Pires from UCLA: Because of the research-supported
More informationComp 426 Midterm Fall 2013
Comp 426 Midterm Fall 2013 I have not given nor received any unauthorized assistance in the course of completing this examination. Name: PID: This is a closed book exam. This page left intentionally blank.
More informationJAVASCRIPT JQUERY AJAX FILE UPLOAD STACK OVERFLOW
page 1 / 5 page 2 / 5 javascript jquery ajax file pdf I marked it as a duplicate despite the platform difference, because as far as I can see the solution is the same (You can't and don't need to do this
More informationPHP / MYSQL DURATION: 2 MONTHS
PHP / MYSQL HTML Introduction of Web Technology History of HTML HTML Editors HTML Doctypes HTML Heads and Basics HTML Comments HTML Formatting HTML Fonts, styles HTML links and images HTML Blocks and Layout
More informationHTML User Interface Controls. Interactive HTML user interfaces. Document Object Model (DOM)
Page 1 HTML User Interface Controls CSE 190 M (Web Programming), Spring 2007 University of Washington Reading: Sebesta Ch. 5 sections 5.1-5.7.2, Ch. 2 sections 2.9-2.9.4 Interactive HTML user interfaces
More informationContents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services
Ajax Contents 1. Overview of Ajax 2. Using Ajax directly 3. jquery and Ajax 4. Consuming RESTful services Demos folder: Demos\14-Ajax 2 1. Overview of Ajax What is Ajax? Traditional Web applications Ajax
More informationFrontend UI Training. Whats App :
Frontend UI Training Whats App : + 916 667 2961 trainer.subbu@gmail.com What Includes? 1. HTML 5 2. CSS 3 3. SASS 4. JavaScript 5. ES 6/7 6. jquery 7. Bootstrap 8. AJAX / JSON 9. Angular JS 1x 10. Node
More informationCOMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts
COMP284 Scripting Languages Lecture 14: JavaScript (Part 1) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool
More informationUpload to your web space (e.g., UCSC) Due this Thursday 4/8 in class Deliverable: Send me an with the URL Grading:
CS 183 4/6/2010 Build a simple HTML page, topic of your choice Will use this as a basis and gradually and add more features as the class progresses Need to be done with your favorite text editor, no visual
More informationAngularJS Fundamentals
AngularJS Fundamentals by Jeremy Zerr Blog: http://www.jeremyzerr.com LinkedIn: http://www.linkedin.com/in/jrzerr Twitter: http://www.twitter.com/jrzerr What is AngularJS Open Source Javascript MVC/MVVM
More informationIntroduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.
Preface p. xiii Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p. 5 Client-Side JavaScript: Executable Content
More informationIndex. Ray Nicholus 2016 R. Nicholus, Beyond jquery, DOI /
Index A addclass() method, 2 addeventlistener, 154, 156 AJAX communication, 20 asynchronous operations, 110 expected and unexpected responses, 111 HTTP, 110 web sockets, 111 AJAX requests DELETE requests,
More informationMASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M
MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M COURSE OBJECTIVES Enable participants to develop a complete web application from the scratch that includes
More informationGRITS AJAX & GWT. Trey Roby. GRITS 5/14/09 Roby - 1
AJAX & GWT Trey Roby GRITS 5/14/09 Roby - 1 1 Change The Web is Changing Things we never imagined Central to people s lives Great Opportunity GRITS 5/14/09 Roby - 2 2 A Very Brief History of Computing
More informationNetworking & The Web. HCID 520 User Interface Software & Technology
Networking & The Web HCID 520 User Interface Software & Technology Uniform Resource Locator (URL) http://info.cern.ch:80/ 1991 HTTP v0.9 Uniform Resource Locator (URL) http://info.cern.ch:80/ Scheme/Protocol
More informationIntroduction to DHTML
Introduction to DHTML HTML is based on thinking of a web page like a printed page: a document that is rendered once and that is static once rendered. The idea behind Dynamic HTML (DHTML), however, is to
More informationCERTIFICATE IN WEB PROGRAMMING
COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING
More informationCGS 3066: Spring 2015 JavaScript Reference
CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within
More informationServer-Side Web Programming: Java. Copyright 2017 by Robert M. Dondero, Ph.D Princeton University
Server-Side Web Programming: Java Copyright 2017 by Robert M. Dondero, Ph.D Princeton University 1 Objectives You will learn about: Server-side web programming in Java, via Servlets The Spark web app framework
More informationCS50 Quiz Review. November 13, 2017
CS50 Quiz Review November 13, 2017 Info http://docs.cs50.net/2017/fall/quiz/about.html 48-hour window in which to take the quiz. You should require much less than that; expect an appropriately-scaled down
More informationJavaScript CS 4640 Programming Languages for Web Applications
JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation
More informationJAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 1 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) WHO
More informationJavascript. Many examples from Kyle Simpson: Scope and Closures
Javascript Many examples from Kyle Simpson: Scope and Closures What is JavaScript? Not related to Java (except that syntax is C/Java- like) Created by Brendan Eich at Netscape later standardized through
More informationModule 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains 2 components
Module 5 JavaScript, AJAX, and jquery Module 5 Contains 2 components Both the Individual and Group portion are due on Monday October 30 th Start early on this module One of the most time consuming modules
More informationModern and Responsive Mobile-enabled Web Applications
Available online at www.sciencedirect.com ScienceDirect Procedia Computer Science 110 (2017) 410 415 The 12th International Conference on Future Networks and Communications (FNC-2017) Modern and Responsive
More informationCHAPTER 6 JAVASCRIPT PART 1
CHAPTER 6 JAVASCRIPT PART 1 1 OVERVIEW OF JAVASCRIPT JavaScript is an implementation of the ECMAScript language standard and is typically used to enable programmatic access to computational objects within
More informationThe course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.
Web Development WEB101: Web Development Fundamentals using HTML, CSS and JavaScript $2,495.00 5 Days Replay Class Recordings included with this course Upcoming Dates Course Description This 5-day instructor-led
More informationSession 6. JavaScript Part 1. Reading
Session 6 JavaScript Part 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/ JavaScript Debugging www.w3schools.com/js/js_debugging.asp
More informationModule 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains an Individual and Group component
Module 5 JavaScript, AJAX, and jquery Module 5 Contains an Individual and Group component Both are due on Wednesday October 24 th Start early on this module One of the most time consuming modules in the
More informationJavaScript. History. Adding JavaScript to a page. CS144: Web Applications
JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary
More information,
Weekdays:- 1½ hrs / 3 days Fastrack:- 1½hrs / Day [Class Room and Online] ISO 9001:2015 CERTIFIED ADMEC Multimedia Institute www.admecindia.co.in 9911782350, 9811818122 Welcome to one of the highly professional
More information55191: Advanced SharePoint Development
Let s Reach For Excellence! TAN DUC INFORMATION TECHNOLOGY SCHOOL JSC Address: 103 Pasteur, Dist.1, HCMC Tel: 08 38245819; 38239761 Email: traincert@tdt-tanduc.com Website: www.tdt-tanduc.com; www.tanducits.com
More informationSimple AngularJS thanks to Best Practices
Simple AngularJS thanks to Best Practices Learn AngularJS the easy way Level 100-300 What s this session about? 1. AngularJS can be easy when you understand basic concepts and best practices 2. But it
More informationEtanova Enterprise Solutions
Etanova Enterprise Solutions Front End Development» 2018-09-23 http://www.etanova.com/technologies/front-end-development Contents HTML 5... 6 Rich Internet Applications... 6 Web Browser Hardware Acceleration...
More informationJavaScript Patterns O'REILLY* S toy an Stefanov. Sebastopol. Cambridge. Tokyo. Beijing. Farnham K8ln
JavaScript Patterns S toy an Stefanov O'REILLY* Beijing Cambridge Farnham K8ln Sebastopol Tokyo Table of Contents Preface xiii 1. Introduction 1 Patterns 1 JavaScript: Concepts 3 Object-Oriented 3 No Classes
More informationNotes General. IS 651: Distributed Systems 1
Notes General Discussion 1 and homework 1 are now graded. Grading is final one week after the deadline. Contract me before that if you find problem and want regrading. Minor syllabus change Moved chapter
More informationAJAX Programming Chris Seddon
AJAX Programming Chris Seddon seddon-software@keme.co.uk 2000-12 CRS Enterprises Ltd 1 2000-12 CRS Enterprises Ltd 2 What is Ajax? "Asynchronous JavaScript and XML" Originally described in 2005 by Jesse
More informationJava SE7 Fundamentals
Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various
More informationCOS 333: Advanced Programming Techniques
COS 333: Advanced Programming Techniques Robert M. Dondero, Ph.D. Princeton University Please pick up handouts at the back of the room 1 COS 333: Course Overview Copyright 2018 by Robert M. Dondero, Ph.D.
More informationBasics of Web Technologies
Dear Student, Based upon your enquiry we are pleased to send you the course curriculum for Web Designing Given below is the brief description for the course you are looking for: Introduction to Web Technologies
More informationCOMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts
COMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool
More informationAjax Ajax Ajax = Asynchronous JavaScript and XML Using a set of methods built in to JavaScript to transfer data between the browser and a server in the background Reduces the amount of data that must be
More informationDATABASE SYSTEMS. Introduction to web programming. Database Systems Course, 2016
DATABASE SYSTEMS Introduction to web programming Database Systems Course, 2016 AGENDA FOR TODAY Client side programming HTML CSS Javascript Server side programming: PHP Installing a local web-server Basic
More informationCISC 1600 Lecture 2.4 Introduction to JavaScript
CISC 1600 Lecture 2.4 Introduction to JavaScript Topics: Javascript overview The DOM Variables and objects Selection and Repetition Functions A simple animation What is JavaScript? JavaScript is not Java
More informationKyle Rainville Littleton Coin Company
Kyle Rainville Littleton Coin Company What is JSON? Javascript Object Notation (a subset of) Data Interchange Format Provides a way for communication between platforms & languages Derived from Javascript
More informationjquery and AJAX
jquery and AJAX http://www.flickr.com/photos/pmarkham/3165964414/ Dynamic HTML (DHTML) Manipulating the web page's structure is essential for creating a highly responsive UI Two main approaches Manipulate
More informationHands On, Instructor-Led IT Courses Across Colorado
Hands On, Instructor-Led IT Courses Across Colorado Offering instructor-led courses in: Java, Java EE and OOAD SQL Programming and SQL Server UNIX, Linux Administration.NET Programming Web Programming
More informationOutline. Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling
Outline Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling Wendy Liu CSC309F Fall 2007 1 2 Document Object Model (DOM) An defined application programming
More informationJavaScript: Introduction, Types
JavaScript: Introduction, Types Computer Science and Engineering College of Engineering The Ohio State University Lecture 19 History Developed by Netscape "LiveScript", then renamed "JavaScript" Nothing
More informationAJAX: Rich Internet Applications
AJAX: Rich Internet Applications Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming AJAX Slide 1/27 Outline Rich Internet Applications AJAX AJAX example Conclusion More AJAX Search
More informationP a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages
P a g e 1 Online Course k72853 Scripting and Web Languages P a g e 2 Title Estimated Duration (hrs) JsRender Fundamentals 2 Advanced JsRender Features 3 JavaScript SPA: Getting Started with SPA in Visual
More informationJavaScript: the language of browser interactions. Claudia Hauff TI1506: Web and Database Technology
JavaScript: the language of browser interactions Claudia Hauff TI1506: Web and Database Technology ti1506-ewi@tudelft.nl Densest Web lecture of this course. Coding takes time. Be friendly with Codecademy
More informationJavaScript. History. Adding JavaScript to a page. CS144: Web Applications
JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary
More informationCOS 333: Advanced Programming Techniques. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University
COS 333: Advanced Programming Techniques Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University 1 Agenda Introductions Course Overview Resources Topics Assignments Project (briefly) Schedule (briefly)
More informationCSC309: Introduction to Web Programming. Lecture 11
CSC309: Introduction to Web Programming Lecture 11 Wael Aboulsaadat Servlets+JSP Model 2 Architecture 2 Servlets+JSP Model 2 Architecture = MVC Design Pattern 3 Servlets+JSP Model 2 Architecture Controller
More informationJavaScript: the Big Picture
JavaScript had to look like Java only less so be Java's dumb kid brother or boy-hostage sidekick. Plus, I had to be done in ten days or something worse than JavaScript would have happened.! JavaScript:
More informationINDEX SYMBOLS See also
INDEX SYMBOLS @ characters, PHP methods, 125 $ SERVER global array variable, 187 $() function, 176 $F() function, 176-177 elements, Rico, 184, 187 elements, 102 containers,
More informationIntroduction to AngularJS
CHAPTER 1 Introduction to AngularJS Google s AngularJS is an all-inclusive JavaScript model-view-controller (MVC) framework that makes it very easy to quickly build applications that run well on any desktop
More informationBEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from
BEFORE CLASS If you haven t already installed the Firebug extension for Firefox, download it now from http://getfirebug.com. If you don t already have the Firebug extension for Firefox, Safari, or Google
More information