I've searched around and for something so easy I can't find a solution that works for me. I have a table object with an ID. I'm using JQuery to grab the ID on the clicked object and want to pass it my datasource, but i'm not able to. Can someone help me out?
HTML:
<a href="#" data-toggle="modal" data-target="#clusterpulse" id="cluster1">cluster1</a>
JavaScript:
<script>
$("table").delegate("a", "click", function() {
id2=$(this).attr('id');
});
$('#cluster_pulse_table').dataTable( {
"bprocessing": true,
"bserverSide": true,
"sAjaxSource": "../scripts/cluster_pulse.php?val=" + id2,
} );
</script>