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
window.jQuery = (window.jQuery || {}); | |
(function() { | |
var uuid = 0; | |
var expando = "jQuery" + +new Date; // like "jQuery123456789" | |
jQuery._cache = {}; | |
jQuery.data = function( elem, name, value ) { | |
if (typeof value == "undefined") { |
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
# you made changes in the css_select folder on the master branch | |
# but now you want to move that work into a working branch | |
# and restore the master to what is in the remote repository | |
$ git branch | |
* master | |
$ git branch fix_css_selectors | |
* master | |
fix_css_selectors | |
$ cd .. |
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 paras = $("p"); | |
// all paras get object with cherry flavor | |
paras.data("desert", { flavor: "cherry" }); | |
// modify flavor property of the first para | |
$(paras.get(0)).data("desert").flavor = "lime"; | |
// see flavor property of the second para | |
console.log( $(paras.get(1)).data("desert").flavor ); // it's lime |
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
$ diff qunit.js qunit.patched.js | |
369c369,370 | |
< if ( GETParams[i] === "noglobals" ) { | |
--- | |
> if ( GETParams[i].indexOf('=') > -1 ) { GETParams.splice( i, 1 ); i--; } | |
> else if ( GETParams[i] === "noglobals" ) { |
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"> | |
setTimeout( | |
function() { | |
stack.push('2'); | |
} | |
,0 | |
); | |
stack.push('1'); | |
</script> |
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
Glow.provide({ | |
version: 'src', | |
builder: function(glow) { | |
glow.snickers = glow.snickers || {}; | |
/** | |
@name glow.snickers.snack | |
@constructor | |
*/ | |
glow.snickers.snack = function() { |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Example</title> | |
<script type="text/javascript" src="http://node1.bbcimg.co.uk/glow/gloader.0.1.2.js"> | |
gloader.use("glow", | |
{map: "http://node1.bbcimg.co.uk/glow/glow/map.1.7.0.js"} |
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 Hello(name) { | |
// create context | |
var my = {}; | |
my.name = name || 'you'; | |
// define methods | |
function greet(name) { | |
name = name || my.name; | |
alert('Hello '+name+'.'); | |
} |
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(undefined) { | |
if (window.Glow !== undefined) { return; } | |
var Glow = function(version) { | |
if (Glow.versions[version] !== undefined) { | |
return Glow.versions[version]; | |
} | |
var glow = function(arg) { | |
if (arg.indexOf('<', arg) === 0) { return glow.dom.create(arg); } |
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
head = document.getElementsByTagName('head')[0]; | |
link = document.createElement('link'); | |
link.href = src; | |
link.type = 'text/css'; | |
link.rel = 'stylesheet'; | |
head.insertBefore(link, head.firstChild); |
OlderNewer