Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Listeners Not Working after performing load()
    primarykey
    data
    text
    <p>I have a DIV that contains paginated results of a MySQL query.</p> <p>I was attempting to use the .load() function to change the content of the DIV based upon the page number clicked.</p> <p>The functionality worked perfect except for the other event listeners stopped working properly. In the query results I had several listeners for clicking on different buttons etc which stopped working once I navigated away from page 1 even though the parent page never changes and the ids and names of the content is the same.</p> <p>This is the jquery I was using.</p> <pre><code>$('input[name="pagenumbutton"]').click(function(){ var thispagenum = this.value; var thispagestart = (thispagenum - 1) * 10; $("#result").load("querydb.php", "thispagestart="+thispagestart); }); </code></pre> <p>after clicking any of the inputs named pagenumbutton the result div content would update but then the following jquery would no longer fire.</p> <pre><code>$('img[name="appdetailimg"]').click(function(){ var appName = $(this).parent().parent().children().get(0).textContent; var appDetail = $(this).parent().children().get(1).value; document.getElementById('detaildivtd').textContent = appName + " : DETAIL"; document.getElementById('detailtext').value = appDetail; $("div#fuzz").fadeIn(); $("div#detaildiv").center(); $("div#detaildiv").show(); }); </code></pre> <p>Everything works perfectly fine if I change the page statically and reload the entire index page but not when I use the .load() function to only reload the div.</p> <p>Is this expected behavior with the .load() function or am I missing something?</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