Dust versus AngularJS

JavaScript Framework Dust:
http://akdubya.github.io/dustjs/#guide

AngularJS versus Dust
Refer: http://stackoverflow.com/questions/15336187/what-is-the-difference-between-angularjs-and-dust-js

Dust.js is purely a templating module. So, it allows the combination of json with a template to deliver html output.

Angular.js is client side framework that allows binding of logic to variables defined in a template (your page).

So, with dust.js you are responsible for deciding when to run the json through the template. Typically you feed in the json on the server (or client) and ask it to render the results.

With angular.js when the model (the json) changes the framework re-renders as appropriate. Triggers for that change could be user actions (such as filling a form in) or it could be due to loading some fresh json from a service.

Typically you would use angular.js if you want a single page JS app (think gmail). dust.js is perhaps more akin to a traditional approach with multi pages with content driven by passing in json.

You could even use the both of them in tandem - server side rendering using dust.js with dynamic client side logic in angular.js.

Unescape or Escape with JavasScript Solutions

Solution for JavaScript

function unescapeHTML(html) {
var htmlNode = document.createElement("DIV");
htmlNode.innerHTML = html;
if(htmlNode.innerText !== undefined)
return htmlNode.innerText; // IE
return htmlNode.textContent; // FF
}

Solution for JQuery

function unescapeHTML(html) {
return $("<div />").html(html).text();
}
function escapeHTML(html) {
return $("<div />").text(html).html();
}

JavaScript unescape() Function

var str = "Need tips? Visit W3Schools!";
var str_esc = escape(str);
document.write(str_esc + "<br>")
document.write(unescape(str_esc))

The output of the code above will be:
Need%20tips%3F%20Visit%20W3Schools%21
Need tips? Visit W3Schools!

The unescape() function was deprecated in JavaScript version 1.5. Use decodeURI()

JavaScript decodeURI() Function

var uri = "my test.asp?name=ståle&car=saab";
var enc = encodeURI(uri);
var dec = decodeURI(enc);
var res = enc + "<br>" + dec;

The result of res will be:
my%20test.asp?name=st%C3%A5le&car=saab      // Encoded URI
my test.asp?name=ståle&car=saab             // Decoded URI

Page Flipping Animation

Use JavaScript to emulate a web booking where the user can flip the pages.

http://www.sitepoint.com/blogs/2007/07/20/javascript-sprite-animation-using-jquery/