Last active
September 20, 2017 10:32
-
-
Save ScalableJS/00a5c3a8632021f04355306dc6ed9395 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var whenReady = function (name, context) { | |
context = context || window; | |
var def = Deferred(), _value; | |
Object.defineProperty(context, name, { | |
configurable: true, | |
get: function () { | |
return _value; | |
}, | |
set: function (value) { | |
_value = value; | |
def.resolve(); | |
} | |
}); | |
return def; | |
}; | |
//Dom is ready | |
whenReady('$') | |
.done(function () { | |
$(document).ajaxComplete(function (event, xhr, settings) { | |
var runtime = $.parseJSON(arguments[1].responseText).runtime; | |
genCampaign(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment