I am calling two function one Java script and one Jquery function on click of Cancel button.
The java script function get executed before Jquery function and I want the exactly opposite.
Here is my HTML code
<button type="button" class="noWarning" id="cancelButton"
onclick="javascript: showMessage('cancelButton', 'Cancelling...'); disableButtons(); submitForm('${cancelDataRequestFormUrl}');">
Cancel</button>
The Jquery function
$(".noWarning").click(function()
{
needToConfirm = false;
alert("NeedToConfirm : " + needToConfirm);
});
showMessage('cancelButton', 'Cancelling...'); get executed before $(".noWarning").click(function()) so how can I change the execution order ?
EDIT:
I tried same with another button
<button type="button" class="noWarning" id="saveButton"
onclick="javascript: submitDataRequest('saveButton', 'Saving...', 'newDataRequestForm', '${saveDataRequestFormUrl}', '${successSaveDataRequestFormUrl}');">
Save as Draft</button>
And its working fine Jquery function is getting called before onClick functions.
Which puts more confusion.