0

issue on page refresh when I send a value of $.post I have a page with 4 buttons on it and when I press a button the page only refreshs once and the rest of the buttons does not work any more. The idee is to refresh the whole frame where the button are in with every click.

<script>            
$(document).ready(function() {

    $("button").click(function(){
        var status = $(this).attr('data-value');                
        $.post('', {status:status}, function(data){});
        $("#refresh_frame").load('index.php #refresh_frame'); 

    });                
});
</script>
Barmar
  • 741,623
  • 53
  • 500
  • 612
phpFreak
  • 133
  • 1
  • 1
  • 8
  • possible duplicate of [Event binding on dynamically created elements?](http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements) – Barmar May 02 '14 at 22:08
  • not sure what u mean. – phpFreak May 02 '14 at 22:15
  • Every time you use `.load()` you're replacing that part of the DOM with new, dynamically created elements. So all your bindings in the original DOM that you overwrote will be lost. You need to use event delegation to deal with this. – Barmar May 02 '14 at 22:17

0 Answers0