calling function with string

http://stackoverflow.com/questions/18257964/call-an-javascript-function-and-pass-in-callback-function

by TastyBytes

JavaScript

another_js_function = function(testStr) {
    alert(testStr);
}

a_js_function = function(testStr, callback) {
    console.log( this.window );
    window[callback].call(this, testStr);
    // OR
    window[callback](testStr);
    
}

a_js_function("howdy y'all", "another_js_function");