Here is the program I run: this.handleExcelExporter = function(href, cols) { var form = $('<form method="post"><input type="submit" /><input type="hidden" name="layout" /></form>').attr('action', href); $('input[name="layout"]', form).val(JSON.stringify(cols)); $('input[type="submit"]', form).click(); } After I run, it returns an error: