Skip to content

Instantly share code, notes, and snippets.

View mikeyledoux's full-sized avatar

Mike LeDoux mikeyledoux

View GitHub Profile
@mikeyledoux
mikeyledoux / lib_loader_js
Last active December 5, 2017 21:31
HTML5 Boilerplate-friendly CORE JS Lib Loader: An improvement on my 'jQuery Lib Loader'. It doesn't rely on jQuery. It can pull in assets at will and be used anywhere in the body.
var Ajax = function (url, callback, where) {
"use strict";
var _this = this;
_this.httpRequest = false;
_this.callback = callback;
_this.where = where;
_this.url = url;
_this.init();
};
Ajax.prototype = {
@mikeyledoux
mikeyledoux / jQuery Lib Loader
Last active October 14, 2015 00:27
Use this to load in a JS dependency on the fly, FROM your other js files. [usage examples at the bottom] Background: Sometimes we don't want to load every JS file we use on every page, because only certain pages use them. Sometimes we may not want to have to use our application framework make the decision about which JS file(s) to use. NOTE: Thi…
var myLIB = {
desc: 'This thing does neato stuff'
};
myLIB.init = function (lib_type, callback) {
"use strict";
if (typeof lib_type !== 'undefined'){
renderScript();
}
function renderScript() {
@mikeyledoux
mikeyledoux / form_validator_fixer_class
Created March 8, 2012 01:56
FormValidator Fixer Class for Magento forms in IE7 & IE9. Works with out-of-box Magento JS. Thanks to Tom Rosario for organizing this into a comprehensive object.
/* FormValidator Fix for IE7 & IE9 */
var ie7 = $j.browser.msie && $j.browser.version=="7.0";
var ie9 = $j.browser.msie && $j.browser.version=="9.0";
var safari =$j.browser.safari;
/*--------------------------------------------------------------------------*/
var FormValidator = function (form, opts) {
this.form = $j(form);
this.required = form.find('.required-entry');