Copy codeThe Code is as follows: // download an Ajax File
JQuery. download = function (url, data, method ){
// Obtain url and data
If (url & data ){
// Data is string or array/object
Data = typeof data = 'string '? Data: jQuery. param (data );
// Assemble parameters into form input
Var inputs = '';
JQuery. each (data. split ('&'), function (){
Var pair = this. split ('= ');
Inputs + = '<input type = "hidden" name = "' + pair [0] + '" value = "' + pair [1] + '"/> ';
});
// Request to send a request
JQuery ('<form action = "' + url + '" method = "' + (method | 'post ') + '">' + inputs + '</form> ')
. AppendTo ('body'). submit (). remove ();
};
};
* ** This is the dynamic rendering form. after submitting the form, delete it. ***
Call an instance Copy codeThe Code is as follows: $. download ('exceldownload. do ', 'Find = commoncode', 'post ');