Example Code: (Please no eval())
var stringReference = "obj.inner.method";
var namespace = stringReference.split(".");
// Now I need to Call window[namespace].call();
I'm a little confused as to how to build out the function call. The end result should look like this?
window[obj][inner][method].call();
Context:
<div data-attribute="click:obj.inner.method" > </div>
I am grabbing a data attribute and binding event listeners based on the data attribute. Also, Thanks in advance.