Game Creations |
||
Home Games Courses Service Forum Chat Shop Links Sitemap Contact |
JavaScript WorkshopWelcome to our JavaScript Workshop!Content 1 - History 2 - Basics 3 - Etc. Links HTML5 CSS3 JS - Workshop JavaScript & jQuery - Workshop Canvas IDL Webdesign History Basics HTML CSS Knowledge <script> JavaScript code </script> // Comments single line /* Comments also possible */ // Extra comments /* Comments line1 * Comments line2 * Comments line3 etc.*/ JS write in <head> or <body> or .js sheet <script src="library.js"> API - an application programming interface, specifies how some software components should interact with each other. JS no input output - uses host environment, web browsers = client-side JS. HTML5 <canvas> is used for graphics API. Interpreter or editor or browser, Firebug etc. - Find it in browsers Tools menu "Developer Tools" or "Web Console." Chrome command-option f - or use the function console.log() or alert('Hello World!'); ECMAScript ES3 or ES5 are standard for JS in browsers. ES4 was never released. JS 1.5 or 1.8 etc. are Mozilla's version numbers, and Google calls the current enterpreter JS V8, and the engine 3.0. Case sensivity - while While WHILE - online Online OnLine ONLINE Whitespace linebreaks etc. are ignored // JavaScript supports several literals - types of values x = 1; // Numbers. x = 0.01; // Just one Number type for integers and reals. x = "hello world"; // Strings of text in quotation marks. x = 'JavaScript'; // Single quote marks also delimit strings. x = true; // Boolean values. x = false; // The other Boolean value. x = null; // Null is a special value that means "no value". x = undefined; // Undefined is like null. Objects var book = { // Objects are enclosed in curly braces. topic: "JavaScript", fat: true }; // The curly brace marks the end of the object. // Access the properties of an object with . or []: book.topic book["fat"] Arrays (numerically indexed lists) of values var primes = [2, 3, 5, 7]; // An array of 4 values, delimited with [ and ]. // Functions are parameterized blocks of JavaScript code that we can invoke. function plus1(x) { // Define a function named "plus1" with parameter "x" return x+1; // Return a value one larger than the value passed in } // Functions are enclosed in curly braces When we combine functions with objects, we get methods. Operators + - * / "3"+"2"="32" var count = 0; count++ count-- count+= count*= count = == != < <= > >= "two" = "three" && || (alt& english) ! In JS expressions are like "phrases" without an ending symbol, statements are like "full sentences" and end with ; - There is actually a lot of overlap between statements and expressions. Roughly, an expression is something that computes a value but doesn’t do anything: it doesn’t alter the program state in any way. Statements, on the other hand, don’t have a value (or don’t have a value that we care about), but they do alter the state. Identifiers used to name variables, functions, provide labels for certain loops Must begin with letter, underscore _ , or $ Examples: i my_varible_name v13 _dummy $str Reserved words: break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch this throw true try typeof var void while with Reserved keywords in ECMAScript 5: class const enum export extends import super Reserved in JS strict mode: implements let private public yield interface package protected static No use as identifiers, not allowed as variable, function, or parameter names: arguments eval ECMAScript 3 reserved all keywords of Java language: abstract boolean byte char class const double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile Predifined global variables and functions - no use for own varibales and functions: arguments Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error eval EvalError Function Infinity isFinite isNaN JSON Math NaN Number Object parseFloat parseInt RangeError ReferenceError RegExp String SyntaxError TypeError undefined URIError Keep in mind that JavaScript implementations may define other global variables and functions, and each specific JavaScript embedding (client-side, server-side, etc.) will have its own list of global properties. *** Chapter 3 - Types, Values, and Varibles - JS The Definite Guide p29 - 2 types of variables: primitive types (numbers, strings, booleans - also values null and undefined) and object types (all other types - unordered collection of named values). Arrays are ordered numbered collections. Arrays have some special behavior that distinguishes them from ordinary objects. p30 - Another object is a function, it has executable code associated with it. Functions are true values and JavaScript programs can treat them like regular objects. Functions that are written to be used (with the new operator) to initialize a newly created object are known as constructors. Each constructor defines a class of objects — the set of objects initialized by that constructor. Classes can be thought of as subtypes of the object type. In addition to the Array and Function classes, core JavaScript defines three other useful classes. The Date class defines objects that represent dates. The RegExp class defines objects that represent regular expressions (a powerful pattern-matching tool described in Chapter 10). And the Error class defines objects that represent syntax and runtime errors that can occur in a JavaScript program. You can define your own classes of objects by defining appropriate constructor functions. garbage collection To sort the elements of an array a, for example, we don’t pass a to a sort() function. Instead, we invoke the sort() method of a: a.sort(); // The object-oriented version of sort(a). Types with methods and without, mutable or immutable. p31 - JS converts one type in another, number in string, boolean in nonboolean etc. == equality operator. JS variables are untyped. Can assign value to variable and later another value to same variable. Defined with var keyword. JS uses lexical scoping. Variables declared out- side of a function are global variables and are visible everywhere in a JavaScript program. Variables declared inside a function have function scope and are visible only to code that appears inside that function. 3.1 Numbers ********* Core JavaScript Reference - Part III p717 Arguments 719 Array 721 Boolean 740 Date 742 Error 769 EvalError 774 Function 775 Global 781 JSON 786 Math 789 Number 801 Object 808 RangeError 828 ReferenceError 829 RegExp 829 String 835 SyntaxError 852 TypeError 853 URIError 855-856 ********* S2 - Thu, 2014-3-20, 16:30-20:10, 21:15-21:30, 22:15-0:30 S1 - Wed, 2014-3-19, 10:40-11:55, 13:55-14:10, 14:40-15:00, 16:15-17:15, 18:00-20:10 Links Programming basics using JavaScript - webplatform.org JavaScript tutorials - webplatform.org JavaScript - Brendan Eich - Wikipedia - brendaneich.com - mozilla.org - Twitter 29.6K Firefox - Twitter 2.4M JavaScript - MDN JavaScript Garden Douglas Crockford - The JavaScript Programming Language Brendan Eich - An Introduction to JavaScript Fluent 2014: Brendan Eich - JavaScript Taking Both the High and Low Roads JSON - JavaScript Object Notation - Wikipedia Douglas Crockford - Wikipedia - JavaScript: The Good Parts Learn HTML5 Easily in 6 hours Create a Responsive Website Using HTML5 and CSS3 jQuery - Wikipedia JavaScript Garden JavaScript Tutorial - w3schools.com JavaScript Tutorial - HTML.net JavaScript and jQuery Tutorials - learnjavascript.co.uk good javascript course - stackoverflow.com Learning JavaScript - my experience and advice - Derek Sivers Eloquent JavaScript - A Modern Introduction to Programming - by Marijn Haverbeke - Twitter 2.8K Nicholas C. Zakas - nczonline.net - Professional JavaScript™ for Web Developers - 3rd Edition - Twitter 23.1K blog.reybango.com/about - The Big List of JavaScript, CSS, and HTML Development Tools, Libraries, Projects, and Books - Twitter 13.5K Web technology for developers - Canvas tutorial - MDN Chris Heilmann - HTML5, CSS3 und JavaScript für alle! - Twitter 34.8K 10 amazing JavaScript demos using 1k or less canvasdemos.com/top-100 HTML5 Website Showcase: 48 Potential Flash-Killing Demos mrdoob.com lynda.com javascriptkit.com jqueryui.com colorzilla.com/gradient-editor css3factory.com/linear-gradients cssmatic.com/gradient-generator Demo 1 - HTML5 JS CSS3 _____ Canvas PROFESSIONAL JAVASCRIPT® FOR WEB DEVELOPERS -Third Edition - Nicholas C. Zakas Contents Foreward - by Rey Bango from Microsoft Corporation & jQuery Project Team ... Conventions Page 86 Page 890 - Tue, 2014-3-18,20:20-21:20, 23:40-1:10 Leipzig More coming soon ⌨ |
|
Copyright © 2013-2014 by IDL Productions |