i was searching google just to have way out to generate & submit form by jquery and i found code snippet but few things was not clear to me.
function submitValues(url, params) {
var form = [ '<form method="POST" action="', url, '">' ];
for(var key in params)
form.push('<input type="hidden" name="', key, '" value="', params[key], '"/>');
form.push('</form>');
jQuery(form.join('')).appendTo('body')[0].submit();
}
why [] this third bracket is used like
var form = [ '<form method="POST" action="', url, '">' ];
what is the meaning of the line jQuery(form.join('')).appendTo('body')[0].submit(); why form.join('') has been used and why write like appendTo('body')[0] why [0]
please guide me in detail for those above bold syntax. thanks