It seems that in jquery click event you can only pass anonymous function. It is not possible to pass a normal javascript function. This lead to problems in my code.
function funcCancelClose(testcaseId,update)
{
if(update == false)
{
modalCloseCancel(testcaseId);
}
else
{
modalCloseCancelUpdate(testcaseId, $("#radio-previous_"+testcaseId).val());
}
}
var testcaseId = 891;
var update = false;
$("#modalCancel,#modalClose").click(funcCancelClose(testcaseId,update));
This did not work. Even there is no error message in developer console, behavior of code was wrong