This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Simple Handlebars Example</title> | |
</head> | |
<body> | |
<!-- Template --> | |
<script id="name-tmpl" type="text/x-handlebars-template"> | |
<p>Title: {{ name }} </p> | |
</script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<style type="text/css"> | |
html, | |
body{ | |
padding: 0px; | |
margin: 0px; | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Backbone Trainning</title> | |
</head> | |
<body> | |
<script src="scripts/jquery-1.10.0.js"></script> | |
<script src="scripts/underscore.js"></script> | |
<script src="scripts/backbone.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Calculator = function() { | |
// private members goes here | |
var privateLog = false; | |
var privateConfig = function(shouldLog) { | |
privateLog = shouldLog; | |
}; | |
var privateAdd = function (x,y) { | |
var result = x + y; | |
if (privateLog) { | |
console.log(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function that duplicates an array | |
function duplicateArray(arr) { | |
// create clone of original array using slice | |
var cloneArr = arr.slice(); | |
// concat original array and clone array in one new array (the objective!!) | |
var dupArr = arr.concat(cloneArr); | |
//return the new array | |
return dupArr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forEach(list,callback) { | |
for (var n = 0; n < list.length; n++) { | |
callback.call(list[n]); | |
} | |
} | |
var myArray = ['hello','world']; | |
forEach( | |
myArray, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var greetings = function (){ | |
alert('Hello World!'); | |
}(); |
NewerOlder