Skip to content Skip to sidebar Skip to footer

Two Jquery Functions Listening To The Same Button Click But Only One Works

Code for the first function(keeping in mind its tested and it works fine): $('.create-invoice').on('click',function() { grab_invoice_data(); // Declare a variable v

Solution 1:

You could try to call the second function from the first.

$('.create-invoice').click(function(){
    secondFunction();
    //rest of code
});

var secondFunction = function(){
    //code
};

Solution 2:

As discussed in the comments, the problem is that you accidentally inserted a line which was not meant to be there:

$.download("php/json.php", postArray, 'post');

Just remove this line and it should all work.

Post a Comment for "Two Jquery Functions Listening To The Same Button Click But Only One Works"