Note that there are some explanatory texts on larger screens.

plurals
  1. POevent not triggering after ajax response Jquery
    primarykey
    data
    text
    <p>i have following functions </p> <pre><code> function populateTableData(){ jQuery('select[name="drg-select"]').change(function() { drgValue=jQuery(this).val(); url="http://localhost/url/FetchRecordFromDatabase.php"; jQuery.ajax({ dataType: "json", type: 'post', url: url, data: {drgValue: drgValue}, success:(function(data) { var str = ''; jQuery.each(data, function (key, value) { str += '&lt;tr&gt;&lt;td id="'+value[0]+'" value="'+value[0]+'"&gt;' + value[0] + '&lt;/td&gt;' + '&lt;td id="'+value[1]+'" value="'+value[1]+'"&gt;' + value[1] + '&lt;/td&gt;' + '&lt;td id="'+value[2]+'" value="'+value[2]+'"&gt;' + value[2] + '&lt;/td&gt;' + '&lt;td id="'+value[3]+'" value="'+value[3]+'"&gt;' + value[3] + '&lt;/td&gt;&lt;/tr&gt;'; }); jQuery('table[name=drg_table] tbody').html(str); }) }); }); } </code></pre> <p>and </p> <pre><code> function fetchValuesForDrgDefinition(url,param) { jQuery.ajax({ type:'post', dataType: "json", url: url, data: {hospital_name:param}, success:(function(data) { drawVisualization(data); jQuery('#hospital_title').html(param); }) }); } </code></pre> <p>and this is how i am calling them</p> <pre><code> jQuery( document ).ready(function() { populateTableData(); jQuery("table[name='drg_table'] tr td").click(function(){ var hospital_name=jQuery(this).text(); fetchValuesForDrgDefinition(urlTable,hospital_name); }); }); </code></pre> <p>The problem is when following functions are called for 1st time they work, but if i 1st trigger <strong>populateTableData</strong> and then try <strong>fetchValuesForDrgDefinition</strong> event dont occur. P.S events to these functions are called independently but if called one 1 after other , the later called donot trigger.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload