Skip to content

Instantly share code, notes, and snippets.

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") {
# 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 ..
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
$ 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" ) {
<script type="text/javascript">
setTimeout(
function() {
stack.push('2');
}
,0
);
stack.push('1');
</script>
Glow.provide({
version: 'src',
builder: function(glow) {
glow.snickers = glow.snickers || {};
/**
@name glow.snickers.snack
@constructor
*/
glow.snickers.snack = function() {
<!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"}
function Hello(name) {
// create context
var my = {};
my.name = name || 'you';
// define methods
function greet(name) {
name = name || my.name;
alert('Hello '+name+'.');
}
(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); }
head = document.getElementsByTagName('head')[0];
link = document.createElement('link');
link.href = src;
link.type = 'text/css';
link.rel = 'stylesheet';
head.insertBefore(link, head.firstChild);