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
var myObj = (function () { | |
var data = { | |
products : ["foobar", "bazquirk", "gizmo"], | |
services : ["widgets", "other", "last"] | |
}; | |
return { | |
__noSuchMethod__ : function (id, args) { | |
if (id === 'all_products') return data.products; | |
if (id === 'all_services') return data.services; |
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> | |
<title>Page Title some change </title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script> | |
</head> | |
<body> |
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 ($) { | |
$.fn.chromeFade = function (opts) { | |
var defs = { msTilFade : 2000, fadeSpeed : 500, fadeTo : 0.01 }, | |
sets = $.extend({}, defs, opts), | |
elems = this, | |
fadeFunc = function () { | |
elems.fadeTo(sets.fadeSpeed, sets.fadeTo); | |
}, | |
fadeTimer = setTimeout(fadeFunc, sets.msTilFade); | |
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> | |
<title>jQuery Templating Demo</title> | |
<style type="text/css"> | |
html { | |
background:#f3f3f3; | |
font: 13px/1.5 helvetica, arial, san-serif; | |
} | |
ul { |
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
sample gist |
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
var array = ["one", "two", "three", "four", "five"]; | |
document.writeln(array + "<br />"); | |
var newArray = shuffle(array); | |
document.writeln(newArray); | |
function shuffle (arr) { | |
var copy = arr.concat(), |
NewerOlder