This file contains 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
document.write( '<script src="//code.jquery.com/jquery-' + version + '.js"><\/script>' ); |
This file contains 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 verMatch = /jqversion=([\w\.]+)/.exec( location.search ), | |
version = verMatch && verMatch[1]; | |
if ( version ) { | |
document.write( '<script src="//code.jquery.com/jquery-' + version + '.js"><\/script>' ); | |
} else { | |
document.write( '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><\/script>' ); | |
} |
This file contains 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> | |
(function(){ | |
// Look for a jqversion query parameter and grab any following version. | |
// Limit to digits and letters to prevent any XSS attempts | |
var verMatch = /jqversion=([\w\.]+)/.exec( location.search ), | |
// our matched version, e.g., 1.6.4 or 1.7rc1 | |
version = verMatch && verMatch[1], | |
src; | |
if ( version ) { | |
// version was specified, use jQuery's CDN to acccess non-mininfied betas and RCs |
This file contains 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(){ | |
var s = "script", | |
n = "\n", | |
d = document, | |
tag = d.getElementsByTagName( s ); | |
console.log( s,n,d,tag); | |
(function parseCoffee() { | |
console.log( 'running' ); | |
// check for a non-src'd script |
This file contains 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 cloud = '', | |
users = {}; | |
$('.js-comment-container').each(function() { | |
var c = $(this), | |
author = c.find('.author .author a').text(), | |
body = c.find('.content-body').text(), | |
words = body.split(' ').length; | |
users[ author ] = users[ author ] || 1; |
This file contains 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
/* | |
* by Dan Heberden / 2011 | |
* demo at http://jsfiddle.net/danheberden/VjKMY/ | |
* made just for Elijah Manor | |
* e.g. | |
* $( 'div' ).findData( 'theDataKey', 'theValue' ); | |
* | |
* will search in the divs and their children | |
*/ | |
(function( $ ){ |
This file contains 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'><!--//<![CDATA[ | |
// wrap in an IIFE to not pollute the global name space - also allows 'document', etc, to be minified | |
(function( window, document ) { | |
document.MAX_used = document.MAX_used || ','; | |
// omitting http or https will use whatever is currently being used. | |
var m3_u = '//www.domain.com/openx/www/delivery/ajs.php?', | |
escape = window.escape, | |
// place the params into an array to be joined with the & later | |
params = [ 'zoneid=10', | |
'cb=' + Math.floor( Math.random() * +new Date() ), |
This file contains 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
getEl = (function (doc) { | |
var getElementsByClassName = (function () { | |
return doc.getElementsByClassName ? | |
function (selector) { | |
return doc.getElementsByClassName(selector.split('.').pop()); | |
} : function (selector) { | |
var parts = selector.split("."), |
This file contains 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 getName = (function() { | |
var cache; // private cache | |
// gets assigned to getName | |
return function() { | |
// return the cache if it's valid or | |
return cache || $.ajax({ | |
url: 'srv/echo', |
This file contains 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 getPrefix( prop ){ | |
var vendorPrefixes = ['Moz','Webkit','Khtml','O','ms'], | |
style = document.createElement('div').style, | |
upper = prop.charAt(0).toUpperCase() + prop.slice(1), | |
pref, len = vendorPrefixes.length; | |
while( len-- ){ | |
if((vendorPrefixes[len] + upper) in style){ | |
pref = (vendorPrefixes[len]); | |
} | |
} |