background preloader


Facebook Twitter

Edit fiddle. AngularJS and Express, rendering ejs-locals partials. How to load another HTML page and read the content with the responseHTML-like feature. There is no responseHTML attribute belong responseText and responseXML in XMLHttpRequest, but this is not a problem.

How to load another HTML page and read the content with the responseHTML-like feature

If we want to get data from another HTML page and insert it into the displayed page, this can be achieved easily. The responseXML attribute holds an XML document DOM can access, and to provide the equivalent for HTML we need just for a <div> tag and a JavaScript function that extends Ajax or the framework we are using. The principle... A variable or a <div> tag to store the other web page. In the second case, the content is not be displayed, as we make use of the display attribute of CSS with the none value. Creating the responseHTML element. Express - Node.js web application framework.

Hogan.js. Getting started Hogan.js is a 3.4k JS templating engine developed at Twitter.


Use it as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates. If you're developing with Node.js, just use NPM to add the Hogan package. $ npm install hogan.js Alternatively, drop hogan.js in your browser by adding the following script. Getters and Setters for CS. There's been plenty of discussion in the CoffeeScript community about the value and viability of adding getter and setter syntax for Object properties.

Getters and Setters for CS

For the Javascript background, see the MDN articles on the get and set operators and their guide to working with objects. Correlating CoffeeScript Classes and JavaScript Prototypes. CoffeeScript has classes, but since CoffeeScript is just JavaScript, where do those classes come from?

Correlating CoffeeScript Classes and JavaScript Prototypes

In this article we break down the JavaScript code which is output from a CoffeeScript class and its subclass to see exactly how the magic happens. Warning: JavaScript Ahead.

Angular JS

Hapticdata/Socket-Sketch. Ninetwentyfour/Video-Canvas. Write Text Anywhere With HTML5 Canvas. Body { background: #111; color:#eee; #c { width: 640px; height: 360px; border:1px solid #111; float:left; background:#eee; #main{ width:650px; margin:auto; $('#c').mousedown(function(e){ if ($('#textAreaPopUp').length == 0) {

Write Text Anywhere With HTML5 Canvas

Danielearwicker/carota. Gulp.js plugin registry. Soulwire » Experiments in Code. 12 Incredible CodePen.IO Demos. Whenever I need to put my ego in check, I go to Chris Coyier's new CodePen.IO site.

12 Incredible CodePen.IO Demos

CodePen.IO is an incredible showcase of HTML, CSS, and JavaScript, displaying the talents of developers creating effects that 99% of the world's front-end developers couldn't create. I spent a few hours while on CodePen, and after I picked my jaw up from the floor, I put together a collection of my favorite CodePen.IO demos. Enjoy! Draw Worm Draw Worm is an eye-catching, canvas-based animation that creates branches; better yet, the animation follows the mouse, creating more branches. Navigation Knob Navigation Knob, created with only HTML and CSS, is a circlear knob which illuminates the selected value when clicked. Trail. Soulwire/sketch.js. Sketch.js. Sketch.js - Simple Canvas-based Drawing for jQuery. Sketch.js has been tested on Chrome (OS X), Firefox (OS X), Safari (OS X), Android Browser (Honeycomb 3.1).

Sketch.js - Simple Canvas-based Drawing for jQuery

It suffers significant performance degradation on mobile browsers due to general HTML5 Canvas performance issues. Copyright (C) 2011 by Michael Bleigh and Intridea, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

.live() Description: Attach an event handler for all elements which match the current selector, now and in the future.


As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live(). This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods: The events argument can either be a space-separated list of event type names and optional namespaces, or an object of event name strings and handlers. $( document ).ready() By John Kossa Wednesday, December 4th, 2013 Yep, it’s time for another module pattern blog.

Understand JavaScript Callback Functions and Use Them. (Learn JavaScript Higher-order Functions, aka Callback Functions)

Understand JavaScript Callback Functions and Use Them