String to function javascript
<p>Say i am using some of the html5 data chars and i want to know what function to call when say something is completed for a certain div tag.</p>

<p>so my data would look like</p>

<pre><code>data-callback='jsAPI.aSubset.desiredFunction'
</code></pre>

<p>How would i convert that callback (a string) into the function that i want to call.  A simple global function such as </p>

<pre><code>data-callback='_myfunction'

&lt;script&gt;
    function _myfunction() { alert("yes my function"); }
    $("div").click(function() {
        var fn = $(this).data("callback");
        if (typeof fn === 'function') {
            fn();
        }
    })
&lt;/script&gt;
</code></pre>

<p>but how do i do it with the previous one <code>jsAPI.aSubset.desiredFunction</code>  Thanks</p>
