In a form I have a hidden field:
<input type="hidden" id="callback_function" value="myFunction" />
Now some JavaScript:
<script>
$('.dataRow').click(function(){
if($('#callback_function').val()){
//same as executing myFunction();
eval($('#callback_function').val()+'();');
}
});
</script>
This works but seems very inelegant. Is there a way to do this without using eval
?