jquery - PHP file being called according to the number of clicks -


i have jquery post:

$('.form-submit').click(function () {     var form = $(this).attr('data-form');      $("#" + form).submit(function (e) {         e.preventdefault();          $.ajax({             url: "../assets/action/action.php",             type: "post",             data: new formdata(this),             contenttype: false,             cache: false,             processdata: false,             success: function (data) {                 $(".return-post-msg").html(data);             }         });     }); }) 

it's working fine, if click button.form-submit again, jquery post called once action.php file called twice. if click again, 3x...

all have in action.php is

echo " alert('".$method." aaaaa'); ";  

to check how many times file being called.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -