Skip to content

Instantly share code, notes, and snippets.

@antennaio
antennaio / jquery-plugin.js
Created October 11, 2012 10:51
jQuery Plugin Boilerplate
/**
* jQuery Plugin Boilerplate
*
* Call the plugin by supplying a method and/or options:
*
* $("element").myplugin();
* $("element").myplugin({ option1: true, option2: true });
* $("element").myplugin("secondary_method");
* $("element").myplugin("secondary_method", { option1: true, option2: true });
*
@antennaio
antennaio / htmlVersion.js
Created December 20, 2010 10:44
Accessing Doctype with Javascript
var Doctype;
var publicId;
var search;
var htmlVersion;
if (document.doctype) {
publicId = document.doctype.publicId;
} else {
/* document.doctype doesn't exist - detect Explorer */
var IE = /*@cc_on!@*/false;