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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -