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> | |
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://ajax.cdnjs.com/ajax/libs/modernizr/1.7/modernizr-1.7.min.js"></script> | |
<style>header{height:100px}</style> | |
</head> | |
<body> |
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> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://ajax.cdnjs.com/ajax/libs/modernizr/1.7/modernizr-1.7.min.js"></script> | |
<style>header{height:100px}</style> | |
</head> | |
<body> |
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 message = 'Spoon!'; | |
$('#foo').bind('click', {msg: message}, function(event) { | |
alert(event.data.msg); | |
}); | |
message = 'Not in the face!'; | |
$('#bar').bind('click', {msg: message}, function(event) { | |
alert(event.data.msg); | |
}); |
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 recurse = function(depth){ | |
try{ | |
return recurse(depth + 1); | |
}catch(ex){ | |
return depth; | |
} | |
}; | |
console.log(recurse(1)); |
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
trackIt: function(p,callback,evil){ | |
//mpg window.mpq.track(label,params{ }); | |
//gaq window._gaq.push('_trackEvent',category,action,label,value); | |
var g = false, m = false; | |
var yesCallback = arguments[1] !== undefined && typeof arguments[1] === 'function'; | |
//window._gaq.push('_trackEvent',p.category,p.action,p.label,p.value); | |
window._gaq.push(['_trackEvent',p.category,p.action,p.label,p.value]); |
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
//document own properties | |
console.log(Object.keys(document).sort()); | |
//document own properties & inherited properties | |
var documentPropertiesIncludeInherited = []; | |
for(var p in document) { documentPropertiesIncludeInherited.push(p); } | |
console.log(documentPropertiesIncludeInherited.sort()); | |
//document inherited properties only | |
var documentPropertiesOnlyInherited = []; |
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
<div data-dojo-type="dojo.data.ItemFileReadStore" data-dojo-id="continentStore" | |
data-dojo-props="url:'{{dataUrl}}/dijit/tests/_data/countries.json'"></div> | |
<div data-dojo-type="dijit.tree.ForestStoreModel" data-dojo-id="continentModel" | |
data-dojo-props="store:continentStore, query:{type:'continent'}, | |
rootId:'continentRoot', rootLabel:'Continents', childrenAttrs:'children'"></div> | |
<div data-dojo-type="dijit.Tree" id="mytree" | |
data-dojo-props="model:continentModel, openOnClick:true"> | |
<script type="dojo/method" data-dojo-event="onClick" data-dojo-args="item"> | |
alert("Execute of node " + continentStore.getLabel(item) |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: '<json:package.json>', | |
meta: { | |
banner: '/*<%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' | |
}, | |
qunit: { |
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
<script> | |
var dojoConfig = { | |
async:true, | |
cacheBust:new Date(), | |
waitSeconds:5 | |
}; | |
</script> | |
<script src="path/to/dojo/dojo.js"></script> |