background preloader

ECMAScript 5 Strict Mode, JSON, and More

ECMAScript 5 Strict Mode, JSON, and More
Previously I analyzed ECMAScript 5’s Object and Property system. This is a huge new aspect of the language and deserved its special consideration. There are a number of other new features and APIs that need attention, as well. The largest of which are Strict Mode and native JSON support. Strict Mode Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a “strict” operating context. Since ECMAScript 5 is backwards-compatible with ECMAScript 3, all of the “features” that were in ECMAScript 3 that were “deprecated” are just disabled (or throw errors) in strict mode, instead. Strict mode helps out in a couple ways: It catches some common coding bloopers, throwing exceptions.It prevents, or throws errors, when relatively “unsafe” actions are taken (such as gaining access to the global object).It disables features that are confusing or poorly thought out. Most of the information about strict mode can be found in the ES5 specification [PDF] on page #235. Related:  ProgrammingJavascript / PatternsJavascript

Storing Objects in HTML5 localStorage Apps Platform This document describes what Gmail contextual gadgets are, how to write them, how to install them, and how to diagnose and fix some common issues. Gmail contextual gadgets can be listed for sale in the Google Apps Marketplace or used within in-house applications installed through the Google Apps console. Prerequisites This document assumes: You know what a gadget is and have a rough idea how to write one (see Getting Started guide for the gadgets.* API).You can post files to public Internet. If you do not have web hosting, then you can post gadgets with the Google Gadget Editor. What is a Gmail contextual gadget? A Gmail contextual gadget is a gadget that is triggered by clues in Gmail, such as the contents of Subject lines and email messages. There are two development and deployment models: Develop a Gmail contextual gadget for use within a single organization's Google Apps domains (an in-house application).List the gadget for sale on the Google Apps Marketplace. Extractor Gadget spec <? <! <! <?

10 Impressive JavaScript Animation Frameworks Complex and slick JavaScript-based animation has been made easier with the emergence of frameworks and libraries that give developers the ability to create stunning and eye-grabbing animation and transition effects that make it easy these complex tasks. In this article, you will read about the top 10 JavaScript-based animation frameworks and libraries that will enable you to create engaging and captivating user experiences. 1. $fx $fx is a compact and lightweight JavaScript animation library which extends native JavaScript DOM methods with its own animation methods and functions. Its small file size (weighing in at only 3.7 KB), hassle-free implementation, and low learning curve makes $fx a powerful option for adding eye-popping animation effects to your web projects. 2. jsAnim Created by web developer Kevin Dolan, jsAnim is a JavaScript animation framework for creating high-impact and slick animation sequences for web interfaces. 3. scripty2 5. 6. 7. 8. 9. 10. Related content

jslibraryboilerplate by dciccale An easy boilerplate for rolling your own JavaScript Library like jQuery, Zepto, Prototype, etc. The code is written in CoffeeScript, TypeScript and pure JavaScript. Skip this if you want to use pure JavaScript version For compiling CoffeeScript or TypeScript you will need to install Node.js After installing Node.js you can compile the files throgh command-line Install CoffeeScript package: npm install -g coffee-script Compile file: coffee jslibraryboilerplate_coffee.coffee Install TypeScript package: npm install -g typescript tsc jslibraryboilerplate_class.ts Include the ´.js´ file in an html document and you are done! Use any valid CSS selector for getting elements from the document // all p elements$('p');// all elements with class 'test'$('.test');// checkboxes$('input[type="checkbox"]'); You can add any method you need to work with a JSLB DOM collection

Build “Rock, Paper, Scissors” in JS | Across Time I Paper Beats Rock i. The Game 1/9 Save and Submit ii. User Choice 2/9 var userChoice = prompt("Do you choose rock, paper or scissors?") iii. var userChoice = prompt("Do you choose rock, paper or scissors?") iv.Computer Choice: Part 2 4/9 var userChoice = prompt("Do you choose rock, paper or scissors?") II Compare Function i. var compare = function(choice1,choice2) { if (choice1 === choice2) { return "The result is a tie!" ii. var compare = function(choice1,choice2) { if (choice1 === choice2) { return "The result is a tie!" iii. var compare = function(choice1,choice2) { if (choice1 === choice2) { return "The result is a tie!" iv. var userChoice = prompt("Do you choose rock, paper or scissors?") v. Like this: Like Loading...

Zend Framework & MVC Introduction - Zend Framework Quick Start Zend Framework Zend Framework is an open source, object oriented web application framework for PHP 5. Zend Framework is often called a 'component library', because it has many loosely coupled components that you can use more or less independently. Using these components, we will build a simple database-driven guest book application within minutes. Model-View-Controller So what exactly is this MVC pattern everyone keeps talking about, and why should you care? Note: More Information Let's break down the pattern and take a look at the individual pieces: Model - This is the part of your application that defines its basic functionality behind a set of abstractions.

caja - Compiler for making third-party HTML, CSS and JavaScript safe for embedding (This site is for programmers actively working on Caja, rather than using it for their own projects.) The Caja Compiler is a tool for making third party HTML, CSS and JavaScript safe to embed in your website. It enables rich interaction between the embedding page and the embedded applications. Caja uses an object-capability security model to allow for a wide range of flexible security policies, so that your website can effectively control what embedded third party code can do with user data. Contacting us Discussions Our discussion group is the best place to contact us. Reporting Bugs & Security Issues Please report potential vulnerabilities using the private issue tracker, and bugs and feature requests via the public issue tracker. Contributing The Caja team includes people from a number of different companies and some private individuals. News Talks

jQuery Lightbox Evolution Lightbox Evolution is a tool for displaying images, html content, maps, and videos in a “lightbox” style that floats overtop of web page. Using Lightbox Evolution, website authors can showcase a wide assortment of media in all major browsers without navigating users away from the linking page. Screenshots Testimonials Themes iPad Compatible Technical Support If you have any questions, please contact me from my profile page here. Changelog 1.8.0 (Aug 17 2013) * jQuery 2.0 compatible * JW Player 6 compatible 1.7.3 (Feb 24 2013) * Fixed multiple galleries bug. * Added youku.com video server. * Fixed '__flash__removeCallback' is undefined error in all versions of IE. 1.7.2 (Feb 21 2013) * Fixed data-options bug with malformed JSON. 1.7.1 (Feb 17 2013) * Now you can change the duration of the transition "loading". 1.7.0 (Jan 25 2013) * Added retina support to default theme. * Added retina support to evolution theme. * Added retina support to carbono theme. * Changed default animation.

Related:  jsonBasics