- Overview - https://developer.spotify.com/web-api/
- Register an app - https://developer.spotify.com/my-applications
- Console for quick testing - https://developer.spotify.com/web-api/console/
- List of the wrappers in various languages - https://developer.spotify.com/web-api/code-examples/#libraries
- Authentication and Authorization Guide - https://developer.spotify.com/web-api/authorization-guide/
This file contains hidden or 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> | |
<link href="style.css" rel="stylesheet" /> | |
<body> | |
<button id="open">click!</button> | |
<div id="popup" class="closed"><button id="close">click!</button></div> | |
</body> | |
<script src="popup.js"></script> | |
<script> | |
var p = document.getElementById('popup'); |
This file contains hidden or 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 delegate(element, eventType, selector, callback, bubble) { | |
var selectorObj = getSelectorType(selector); | |
var callbackFn; | |
selector = selectorObj.value; | |
switch (selectorObj.type) { | |
case 'tag': | |
callbackFn = tagSelector; | |
break; |
This file contains hidden or 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> | |
<meta charset="utf-8" /> | |
<title>Binding the same event listeners more than once</title> | |
</head> |
This file contains hidden or 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
/** | |
* Object descriptor | |
**/ | |
var a = { | |
prop1 : 14 | |
} | |
var descriptorObj1 = Object.getOwnPropertyDescriptor(a, 'prop1'); |
This file contains hidden or 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
#container { | |
background: #fff url(gradient.gif) repeat-x bottom; | |
background: -webkit-gradient( | |
linear, 0 100%, 0 0, | |
from(#ecebe7), color-stop(50%, #fff), to(#fff) | |
); | |
background: -webkit-linear-gradient(bottom, #ecebe7, #fff 50%, #fff); | |
background: -moz-linear-gradient(bottom, #ecebe7, #fff 50%, #fff); | |
} |
This file contains hidden or 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
interface EventTarget { | |
void addEventListener(in DOMString type, | |
in EventListener listener, | |
in boolean useCapture); | |
}; | |
var link = document.getElementById('#myLink'); | |
// use bubbling: | |
link.addEventListener('click', callbackFnForClick, false); |
This file contains hidden or 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> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js" charset="utf-8" type="text/javascript"> | |
</script> | |
<title>Event Loop</title> | |
<style type="text/css"> | |
div {height: 5px; margin-bottom: 3px;} | |
</style> |
This file contains hidden or 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
el.onclick = function(evt) { | |
addStyle.call(this, '#f00', 'solid 2px blue'); | |
} | |
// both will have identical effect | |
el.onclick = function(evt) { | |
addStyle.apply(this, ['#f00', 'solid 2px blue']); | |
} |
This file contains hidden or 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
el.onclick = function(evt) { | |
this.style.backgroundColor = '#f00'; | |
this.style.borderBottom = 'solid 2px blue'; | |
} | |
el2.onclick = function(evt) { | |
this.style.backgroundColor = '#ff0'; | |
this.style.borderBottom = 'dotted 1px green'; | |
} |
NewerOlder