Skip to content

Instantly share code, notes, and snippets.

View jonkemp's full-sized avatar

Jonathan Kemp jonkemp

View GitHub Profile
@jonkemp
jonkemp / query.js
Last active September 25, 2015 06:17
A simple function for getting parameters from a query string.
function query( key ) {
if ( location.href.indexOf("?") !== -1 ) {
var q = location.search,
p = [],
i, val;
q = q.slice(1);
if ( q.indexOf("&") !== -1 ) {
q = q.split("&");
for ( i=0; i < q.length; i++ ) {
p.push( q[i].split("=") );
@jonkemp
jonkemp / jQuery Checkbox Shortcut
Created March 14, 2011 18:41
An alias or shortcut for selecting checkboxes quickly in jQuery.
$.fn.checkbox = function () {
return this.find('input[type="checkbox"]');
};