Last active
February 27, 2016 21:59
-
-
Save Phoen1x84/fde1c95de507441416dd to your computer and use it in GitHub Desktop.
Self invoking function - Revealing module pattern
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
// noConflict mode | |
jQuery.noConflict(); | |
var app = app || {}; | |
app.myFunction = (function ($, undefined) { | |
// do all the things | |
var init = function(){ | |
if (!$('body').hasClass('page-editor')) { // custom class added to the body to check for page editor | |
console.log('Hi friends!'); | |
} | |
}; | |
return { | |
init: init | |
}; | |
})(jQuery); | |
jQuery(document).ready(function () { | |
app.myFunction.init(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment