Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(function($) {
var myTest;
function Test() {
Test.prototype.ready = function() {
$(Test).on("init", function() { console.log("Test init'ed"); });
myTest = new Test();
$(myTest).on("ready", function() { console.log("Test ready'ed"); });

This comment has been minimized.

Copy link
Owner Author

@sukima sukima commented Feb 22, 2013

This causes an infinate loop because when you call $(Test) it sees Test as a function and adds it to the document.ready event which is triggered and executed over and over and over and over and...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.