Skip to content

Instantly share code, notes, and snippets.

@jitter
jitter / gist:703467
Created November 17, 2010 15:01
Links to change on jquery.com

A - [jquery.com][1] site-wide:

  • Link for "Bug Tracker" in header (secondary) and footer navigation from http://dev.jquery.com/ to http://bugs.jquery.com

B - [jquery.com Startpage][2]

  • Linktext from "Source code/SVN" to "Source code/GIT"
  • Link for "Submit a New Bug Report" from http://dev.jquery.com/newticket/ to http://bugs.jquery.com/newticket

C - [Downloading_jQuery][3]

@jitter
jitter / gist:704718
Created November 18, 2010 07:19 — forked from padolsey/gist:527683
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);
// when minified:
(function(w,d,u){ ... })(this,this.document);
// which means all uses of window/document/undefined inside the closure
// will be single-lettered, so big gains in minification.
// it also will speed up scope chain traversal a tiny tiny little bit.
/*!
* jQuery Tiny Pub/Sub - v0.3 - 11/4/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
/*!
* jQuery nodetype filter - v0.1pre - 11/18/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Variation by Anton M.
*/
@jitter
jitter / gist:708161
Created November 20, 2010 21:19
jQuery Ticket 2253 frame1
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>iframe 2</title>
</head>
<body>
<div>iframe 2</div>
</body>
</html>
@jitter
jitter / gist:712171
Created November 23, 2010 17:42
test
jQuery.readyWait += 2;
var go = function () {
$("#foo").attr("value", " Click me again. So jQuery knows it can be ready ");
jQuery.ready(true);
}
@jitter
jitter / gist:804015
Created January 31, 2011 13:20
browser tests for 1.5 final
All browsers were run on Windows XP SP2 (except IE8 on Windows 7).
Missing IE 7
All tests passed (only Opera Mobile has the usual 4 offset failures).
Safari 5.0.3 / 4.0.5 / 3.2.3 / 3.1.2
Opera 11.01 / 11 / 10.63 / 10.54 / 10.10 / 9.64
Opera Mobile 10.00
IE 6 / 8 (IE8 was on Windows 7)
Firefox 4.0b9 / 3.6.13 / 3.5.11 / 3.0.19 / 2.0.0.20
Fennec 1.1b1
@jitter
jitter / fiddle.response.js
Created February 1, 2011 22:11
jsfiddle enhancement
alert( "you got the content-type header right :)" );
jQuery.fn.textFast = function(text) {
if (jQuery.isFunction(text)) {
return this.each(function(i) {
var self = jQuery(this);
self.text(text.call(this, i, self.text()));
});
}
if (typeof text !== "object" && text !== undefined) {
return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text));
}