I have the following code:
var submitHandler = function ($link, $form, close) {
var val = $form.valid();
var action = $form.attr('data-action')
var entity = $form.attr('data-entity')
var href = $form.attr('data-href');
var rownum = $link.attr('data-row');
var $row = $('#row_' + rownum);
var $submitBt = $('.block-footer button:contains("Submit")');
.....
.....
jsonSuccessModal(action, rownum, close, $form, $submitBt, $row);
}
function jsonSuccessModal(action, rownum, close, $form, $submitBt, $row) {
...
}
Rather than have many parameters is there a way I could combine variables
in the first code block and then just send an object that represents the
combination to the jsonSuccessModal. Something like an anonymous object ?
1 Answer