JavaScript

From Things and Stuff Wiki
Revision as of 15:27, 30 December 2012 by Milk (talk | contribs) (→‎Tools)
Jump to navigation Jump to search


todo; again, bookmarks

General

  • ECMAScript wiki - for the ongoing specification work of Ecma TC39, the technical committee tasked with standardization of the ECMAScript programming language. Most of the wiki is world-readable, meaning that anyone can view the pages. Certain sections are restricted to members of the technical committee.
  • A Survey of the JavaScript Programming Language - This document is an introduction to the JavaScript Programming Language for professional programmers. It is a small language, so if you are familiar with other languages, then this won't be too demanding. Douglas Crockford, 2002

Learning

Screencasts

Books

  • JSbooks - The best free JavaScript resources

Articles

Videos

Games

Specs

Syntax

Comments

// this is a comment
/* this is
a multiline
comment */

Hello world

document.write("Hello world!");

document Object : write() method

Strings

.length

var x = 'some string';
alert(x.charAt(0)); // alerts 's'

alert(x.substring(0,1));

var my_car="Cat";
var where_is_a=my_car.indexOf('a');
alert('The a is at position '+where_is_a+'.');
var where_is_mytool="home/mytool/mytool.cgi";
var mytool_array=where_is_mytool.split("/");
alert(mytool_array[0]+" "+mytool_array[1]+" "+mytool_array[2]);

Functions

Objects

Methods

Events

Web scripting

<script>
  document.write("Hello world!");
</script>
<script src="javascript/project.js"></script>

Async

AMD

DOM

Guides

Shadow DOM

Not widely implemented.

Firefox

APIs

Data types

number

to sort

Paradigms

  • DOM Scripting Task Force - An autonomous working group of the Web Standards Project. Our mission is to bring scripting up to parity with XHTML and CSS as a useful and necessary tool for building accessible, user-centric, standards-based web sites.

Patterns

Programming style

Code formatting

  • idiomatic.js - Principles of Writing Consistent, Idiomatic JavaScript. This is a living document and new ideas for improving the code around us are always welcome. Contribute: fork, clone, branch, commit, push, pull request.

JSON

  • JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
  • http://en.wikipedia.org/wiki/JSON
  • https://developer.mozilla.org/en/JSON

Tools

  • jq is like sed for JSON data – you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.

Offline

Repos

  • JSAN - JavaScript Archive Network

CDN

Testing

  • QUnit is a powerful, easy-to-use JavaScript unit test suite. It’s used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code, including itself!.

Documentation

  • JsDoc Toolkit is an application, written in JavaScript, for automatically generating template-formatted, multi-page HTML (or XML, JSON, or any other text-based) documentation from commented JavaScript source code.

JS based

CofeeScript

  • CoffeeScript is a programming language that transcompiles to JavaScript. The language adds syntactic sugar inspired by Ruby, Python and Haskell[1] to enhance JavaScript's brevity and readability, and add more sophisticated features like list comprehension and pattern matching.
  • IcedCoffeeScript is a superset of CoffeeScript. The iced interpreter is a drop-in replacement for the standard coffee interpreter; it will interpret almost all existing CoffeeScript programs.

Coco

  • Coco is a CoffeeScript dialect that aims to be more radical and practical. On its way to hide JavaScript's bad parts, CoffeeScript has accumulated own quirks: horrible variable scope, awkward ranges, confusing and/or pointless keywords, verbose file extension, and so on. Coco tries to amend them, entwining good parts of both.

LiveScript

  • LiveScript is Coco but much more compatible with CoffeeScript, more functional, and more feature rich. LiveScript aims for increased expressiveness and code beauty. While adding features to assist in functional style programming, LiveScript also deeply supports imperative and object oriented programming, and has an optional class system with inheritance, calls to super, and more.

Lua

  • Colony compiles JavaScript to Lua 5.1 source code, that requires only a small support library. Colony can be used in any Lua application supporting the debug library (enabled in Lua 5.1 by default). Colony is experimental.
  • ljs - Lua VM implemented in Javascript
  • lua.js - node.js, lua to javascript compiler, nee lua2js-experiment

Other

  • Tampermonkey is a tool that provides Greasemonkey script support for Google Chrome and Chromium Browser. It's API is fully compatible to Greasemonkey, including GM_registerMenuCommand, GM_xmlhttpRequest with cross domain support and access to the unsafeWindow object.
  • DubJS is a dialect of JavaScript for making web apps with minimal effort. It comes with a strong core framework, and is designed for building any kind of web app, whether it be an entirely dynamic single-page app, a pre-generated static site,1 or something in between. It's focus is client-side development, and as such can be used in combination with your favourite server-side tools.
  • [ http://lispyscript.com/ LispyScript] - A javascript With Lispy Syntax And Macros! An inherent problem with Javascript is that it has no macro support, unlike other Lisp like languages. That's because macros manipulate the syntax tree while compiling. And this is next to impossible in a language like Javascript. In LispyScript we write Javascript in a tree structure. If you know Javascript and a Lisp like language, then using LispyScript will be a breeze. Even if you don't know a Lispy Language, all you need to learn is to write code in a tree structure.
  • LLJS is a typed dialect of JavaScript that offers a C-like type system with manual memory management. It compiles to JavaScript and lets you write memory-efficient and GC pause-free code less painfully, in short, LLJS is the bastard child of JavaScript and C. LLJS is early research prototype work, so don't expect anything rock solid just yet. The research goal here is to explore low-level statically typed features in a high-level dynamically typed language. Think of it as inline assembly in C, or the unsafe keyword in C#. It's not pretty, but it gets the job done.