Skip to content Skip to sidebar Skip to footer

How Do You Run Two Javascript Functions Independently

I have two JavaScript functions: vcenter1(); vcenter2(); I need this functions to run a dropdown click event independent of each other. I have this piece of code: $('a[href*='vmwa

Solution 1:

You have to run the second function after the first asynchronous request is done.

At the end of your vcenter1, add:

return req;

Then modify your code to:

$('a[href*="vmware"]').on('click', function () {
    vcenter1().then(vcenter2);
});

Post a Comment for "How Do You Run Two Javascript Functions Independently"