cletusc Founder

I won't be posting the lib here on OUJS as I won't be supporting it beyond where I left it off as (and I am fine with any changes, given the attribution remains). I would prefer it to be something along these lines:

// @author Ryan Chatham (https://github.com/cletusc/), reposted by Sonny Razzano
// @license CC-NC-SA; http://creativecommons.org/licenses/by-nc-sa/3.0/

Any additional stuff (MIT, etc) is fine by me, I just want to make sure both the name and license are somewhere on there.



Re: @Quackmaster:

cloneInto would work here.

var privilegedFunctions = {
    myCallback: function (event, xhr, settings) {
        console.log('myCallback works as expected!');
        myScope();
    }
};

function myScope() {
    console.log('myScope works as expected!');
}

privilegedFunctions = cloneInto(privilegedFunctions, unsafeWindow, {cloneFunctions: true});

$(document).ajaxComplete(privilegedFunctions.myCallback);