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
<section id="main" data-bind="visible: todos().length"> | |
<input id="toggle-all" data-bind="checked: allCompleted" type="checkbox"> | |
<label for="toggle-all">Mark all as complete</label> | |
<ul id="todo-list" data-bind="foreach: filteredTodos"> | |
<li data-bind="css: { completed: completed, editing: editing }"> | |
<div class="view"> | |
<input class="toggle" data-bind="checked: completed" type="checkbox"> | |
<label data-bind="text: title, event: { dblclick: $root.editItem }"></label> | |
<button class="destroy" data-bind="click: $root.remove"></button> | |
</div> |
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
<form> | |
<input name="item"> | |
<button type="submit">Add Item</button> | |
</form> | |
<ul id="todo-items"> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
<li>Item 3</li> | |
</ul> |
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
"user" : { | |
"name" : "John Smith", | |
"quota" : 100, | |
"_type" : "Administrator" | |
} |
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 id="todo"></div> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.min.js"></script> | |
<script> | |
Todo = React.createClass({ | |
displayName: 'Todo' | |
, | |
getInitialState : function() { | |
return { items: [] }; | |
} |
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
<h4>Todo List</h4> | |
<form> | |
<input name="item"> | |
<button type="submit">Add Item</button> | |
</form> | |
<ul id="todo-items"> | |
<li>Item 1 <button>x</button></li> | |
<li>Item 2 <button>x</button></li> | |
<li>Item 3 <button>x</button></li> | |
</ul> |
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
/* ----------------------------------------------------------------------------- | |
INTERACTING WITH THE USER INTERFACE | |
------------------------------------------------------------------------------*/ | |
// GET HTML (DOM) ELEMENT | |
// I need to reference an HTML element inside javascript: |
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://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
</head> | |
<body> | |
<script> | |
var numbers = [1,2,3,4,5,6,7,8,9]; | |
var randomNumbers = _.shuffle(numbers, numbers.length); |
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> | |
</head> | |
<body> | |
<script> | |
var score = 0; | |
function computeScore(outcome) { | |
if(outcome) { |
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
<form action="/friends" method="POST"> | |
<input type="text" name="lastname"> | |
<button type="submit">Submit</button> | |
</form> |
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
Started GET "/api/v2/searches/autocomplete_term?source=web&warehouse_id=5&zone_id=9" for ::1 at 2015-03-16 13:54:41 -0700 | |
Processing by Api::V2::SearchesController#autocomplete_term as JSON | |
Parameters: {"source"=>"web", "warehouse_id"=>"5", "zone_id"=>"9"} |