background preloader

A JavaScript Blog

The Node Beginner Book » A comprehensive Node.js tutorial Using Google's Closure to Compile and Verify your JavaScript 7, Mar 2013 A large application is nearly guaranteed to come with an equally large amount of JavaScript attached to it. During development it makes sense to divide the JavaScript of the application into multiple sensibly named files both to make finding specific functionality in the code base easier, and to keep the file length to a reasonable size for readability/comprehension purposes. More importantly though, this allows you to build modular, reusable components by separating functionality and sharing common methods within the application. However, when it comes time to move your site to the production environment, this development processes' inefficiencies become noticeable in slow loading pages. The most obvious pitfall is the fact that having multiple different files means that new HTTP requests have to be issued for each file, bringing with it an additional round trip time. Introducing Google Closure The Google Closure Compiler is a tool designed to solve these problems.

Documentation JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module. More docs: List of all JSHint options · CLI flags · Writing your own reporter · FAQ Basic usage The easiest way to use JSHint is to install it as a Node program. To do so, simply run the following command in your terminal (flag -g installs JSHint globally on your system, omit it if you want to install JSHint in the current working directory): $ npm install jshint -g After you've done that you should be able to use the jshint program. $ jshint myfile.js myfile.js: line 10, col 39, Octal literals are not allowed in strict mode. 1 error If a file path is a dash (-) then JSHint will read from standard input. Configuration JSHint comes with a default set of warnings but it was designed to be very configurable. This setup allows you to have different configuration files per project. Inline configuration Directives jshint

janl/mustache.js - GitHub QuirksBlog Below you find the last seven QuirksBlog entries. By default, if you tap on a touchscreen it takes about 300ms before a click event fires. It’s possible to remove this delay, but it’s complicated. I investigated it. continue reading Desktop browsers have only one viewport: the browser window. continue reading In mid-May I’ll be on the West Coast for about 10-16 days, ending at HTML5 Dev Conf 19-22 May. continue reading A month ago Nokia announced its Nokia X product line which runs Android as its operating system. I have a theory about the Nokia X that I’d like to share with you. continue reading Three weeks ago I wrote about installable web apps. continue reading Yesterday I replied to a tweet by Marcos about “add to home screen,” and that kicked off a long and rather interesting conversation about installable web apps. continue reading Returning false, or calling preventDefault(), in an event handler is supposed to prevent the default action of the event. continue reading

Studio The professional, open source development tool for the open web It's ready. It's time. Core Features HTML, CSS, and JavaScript Code Assist Aids in authoring of HTML, CSS, JavaScript, PHP, and Ruby. Code Assist Deployment Wizard Support for one-shot as well as keep-synchronized setups. Deployment Wizard Support for one-shot as well as keep-synchronized setups. Integrated Debugger Set breakpoints, inspect variables, control execution. Integrated Debugger Git Integration Easily put your projects under git source code control. Git Integration Easily put your projects under git source code control. Built-in Terminal Quickly access a command line terminal for execution of operating system commands and language utilities such as gem, rake, etc. Built-in Terminal IDE Customization Setup your development environment exactly the way you want it by extending the core capabilities through scripting of custom commands. IDE Customization

A Javascript When Function Mon Feb 20 2012 function when(conditionFunc, execFunc, interval){ if (conditionFunc()){ execFunc(); }else{ setTimeout(function(){ when(conditionFunc, execFunc, interval);}, interval); } } You have some code which should only execute when a condition is true. E.g. You have code which relies on a javascript library but can't be sure the library has loaded yet and don't want the code to execute until it has. Use when like this... function libIsReady(){ return typeof(LIBRARYNAME) ! Categories

stringify - JavaScript The JSON.stringify() method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. Syntax JSON.stringify([, [, ]]) Parameters value The value to convert to a JSON string. replacer Optional A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting the properties of the value object to be included in the JSON string. space Optional A String or Number object that's used to insert white space into the output JSON string for readability purposes. Description JSON.stringify() converts a value to JSON notation representing it: Properties of non-array objects are not guaranteed to be stringified in any particular order. The replacer parameter The replacer parameter can be either a function or an array. Example with a function Example with an array The space argument See also

{{ mustache }} Logic-less templates. Available in Ruby, JavaScript, Python, Erlang, node.js, PHP, Perl, Objective-C, Java, .NET, Android, C++, Go, Lua, ooc, ActionScript, ColdFusion, Scala, Clojure, Fantom, CoffeeScript, D, Haskell, XQuery, ASP, Io, Dart, and for Haxe Works great with TextMate, Vim, Emacs, and Coda The Manual: mustache(5) and mustache(1) Demo <h1>{{header}}</h1> {{#bug}} {{/bug}} {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.

TechCrunch - The latest technology news and information on startups Dos días de diseño y hacking en la web El viernes 24 y sábado 25 se llevó a cabo el evento Mejorando.la/Conferencia enfocado al diseño y desarrollo web con sede en México. Vivimos horas intensas de aprendizaje y nuevos conocimientos en las 10 conferencias y dos panel realizados en el transcurso del evento, lo genial fue que para quienes no pudimos estar en las sedes era posible ver el evento y participar por medio de redes sociales gracias al streaming. Las conferencias y cursos realizados por el equipo de Mejorando.la se realizan por el interés en la educación y de satisfacer necesidades en hispanoamerica porque en ocasiones las universidades no estan al tanto de las innovaciones continuas. Viernes 24 Con la bienvenida de @stephaniefalla en las instalaciones de Microsoft se dió inicio el primer día de la conferencia, presentando el diseño del evento realizado por Rubén Gómez y el uso de colores dedicados a México. México es estimulante y tiene mucho talento humano. ¿Qué aprendimos? Diseñando experiencias de consumo

35 top examples of JavaScript | JavaScript JavaScript creates platforms that can engage a user and ensure that they remember your site and continue to revisit. It can be used to create games, APIs, scrolling abilities and much more. The internet is full of web design inspiration, including great examples of JavaScript being used to bring a website to life and provide great user experiences. Here we pick some of our favourite examples of JavaScript in action for your inspiration. 01. If you've ever watched Cosmos, you may remember Carl Sagan talking about the Cosmic Calendar. 14 billion years of events is a huge dataset, and displaying it in a browser is no easy task. The son of a historian, Stauber created Histography as a student at Bezalel Academy of Arts and Design, under the guidance of Ronel Mor. The site scans and indexes events from Wikipedia, grabs the article, and pulls in a Google image and YouTube video. 02. 03. For this website about the history of the St. 04. 05. 06. 07. 08. tota11y 09. 10. 11.

Related:  nicolaschenet