Skip to content

Instantly share code, notes, and snippets.

Created Mar 17, 2014
What would you like to do?
document.registerCallback = function(callbackEvent, callbackFunction){
if(typeof document.callbacks == 'undefined')document.callbacks = {};
if(typeof document.callbacks[callbackEvent]=='undefined')document.callbacks[callbackEvent]=[];
return callbackFunction;
document.runCallbacks = function(callbackEvent,arguments){
for(var name in document.callbacks[callbackEvent]){

This comment has been minimized.

Copy link
Owner Author

@andrienko andrienko commented Mar 17, 2014

А потом я такой:

document.registerCallback("pageLoad",function(firstword){console.log(firstword + ', world!');});

И такой типа, где-то глубоко в коде


..и даже параметры передаются.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment