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.
so my data would look like
data-callback='jsAPI.aSubset.desiredFunction'
How would i convert that callback (a string) into the function that i want to call. A simple global function such as
data-callback='_myfunction'
<script>
function _myfunction() { alert("yes my function"); }
$("div").click(function() {
var fn = $(this).data("callback");
if (typeof fn === 'function') {
fn();
}
})
</script>
but how do i do it with the previous one jsAPI.aSubset.desiredFunction Thanks