Skip to content

Instantly share code, notes, and snippets.

//IE6
'RENDERING_INTENT_ABSOLUTE_COLORIMETRIC' is null or not an object
'RENDERING_INTENT_RELATIVE_COLORIMETRIC' is null or not an object
'SVG_PRESERVEASPECTRATIO_UNKNOWN' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMAXYMAX' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMAXYMID' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMAXYMIN' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMIDYMAX' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMIDYMID' is null or not an object
'SVG_PRESERVEASPECTRATIO_XMIDYMIN' is null or not an object
// function $testFunk(arg1,arg2,arg3){
// this.arg1 = arg1;
// this.arg2 = arg2;
// this.arg3 = arg3;
// };
// var shmoo = {
// fred: new $testFunk(1,2,3),
// fred1: new $testFunk(1,2,3),
// fred2: new $testFunk(1,2,3),
// fred3: new $testFunk(1,2,3)
document.activeElement
document.addBinding
document.addEventListener
document.addEventSource
document.adoptNode
document.alinkColor
document.all
document.anchors
document.appendChild
document.applets
var regex = /\b(\w+)(?::(\w+)(?:\((\d+)\))?)?/;
var result;
result = "ease" .match(regex);
console.assert(result[1] == 'ease', "Should match ease" ,result);
result = "ease:in" .match(regex);
var Matcher = (function(M){
function Matcher(context, selectorObj){
M.matcher = [];
// GET
M.matcher.push(
M.getByAll (context, selectorObj) ||
M.getByClass (context, selectorObj) ||
CURRENT CODE:
<div>
<a href="something.html"><img src="myimage.gif" /></a>
</div>
CHANGED CODE:
<div>
Array.makeSortByKey = function makeSortByKey(key){
return Array.makeSortByKey.cache[key]
||(Array.makeSortByKey.cache[key] = function sortBy(a,b){
if (a[key] == b[key]) return 0;
return (a[key] < b[key]) ? -1 : 1;
});
};
Array.makeSortByKey.cache = {};
@subtleGradient
subtleGradient / SubtleClickAll.bookmarklet
Created March 7, 2009 18:50
SubtleClickAll; Takes a CSS selector and executes the click method on each matching element.
javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10);
/*
SubtleSandbox
Copyright 2009 Thomas Aylott (subtleGradient.com)
MIT License
*/
var SubtleSandbox = (function(){
// public
function Sandbox(name){
this.window = makeIframe.call(this, name);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body onload="init();">
<script type="text/javascript" charset="utf-8">
var Sandbox = (function(){