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 Foo(options) { | |
if (!(this instanceof Foo)) { | |
return new Foo(options); | |
} | |
options = options || {}; | |
$.extend(this, { | |
Id: 0, | |
Bar: null, | |
Bars: [] | |
}, options); |
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
$(".navigatorModifierSearch").live('keyup', function (event) { | |
var $navigationelementsContainer = $(this).parent().parent().find(".navigationelementsContainer"); | |
var searchTerm = $(this).val(); | |
if (searchTerm.length > 0) { | |
$navigationelementsContainer.find('div[data-name*="' + searchTerm.toUpperCase() + '"]').removeClass("hideNavElement"); | |
$navigationelementsContainer.children().not('div[data-name*="' + searchTerm.toUpperCase() + '"]').addClass("hideNavElement"); | |
} else { | |
//make sure all are showing | |
$navigationelementsContainer.children().removeClass("hideNavElement"); |
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
<script type="text/javascript"> | |
//from book 'Javascript the Good parts' p.58 | |
//The methods do not make use of this or that. | |
//As a result, there is no way to com- promise the seqer. | |
//It isn’t possible to get or change the prefix or seq | |
//except as per- mitted by the methods. The seqer object | |
//is mutable, so the methods could be replaced, but | |
//that still does not give access to its secrets. | |
//seqer is simply a collection of functions, and |
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 lang="en"> | |
<head> | |
<title>knockout binding test</title> | |
<style type="text/css"> | |
#sidebar { float: left; width: 15em; } | |
#details { float: left; } | |
#sidebar li { list-style: none; } | |
#sidebar a { list-style: none; background-color: silver; width: 8em; margin-bottom: 0.5em; padding: 0.5em; display:block; } | |
#sidebar a.selected { background-color: Navy; color: white; } |
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
<!-- This demonstrates a simple javascript callback --> | |
<div id="now">0</div> | |
<input type="button" id="goBtn" value="Go" /> | |
<br/> | |
<div id="result">Let's go!</div> | |
<script> | |
var result = document.getElementById('result'); | |
function animate(element, callback){ |
NewerOlder