JQuery的AJAX实现文件下载的小例子
代码如下:
var form=$("<form>");//定义一个form表单 form.attr("style","display:none"); form.attr("target",""); form.attr("method","post"); form.attr("action","exportData"); var input1=$("<input>"); input1.attr("type","hidden"); input1.attr("name","exportData"); input1.attr("value",(new Date()).getMilliseconds()); $("body").append(form);//将表单放置在web中 form.append(input1); form.submit();//表单提交
出处:http://www.cnblogs.com/sydeveloper
相关推荐
wcqwcq 2020-07-04
TONIYH 2020-06-11
yhginny 2020-04-20
nicepainkiller 2020-05-12
Lius 2020-05-05
longshengguoji 2020-02-13
ajaxtony 2020-02-03
HSdiana 2019-12-15
taiyanghua 2019-12-02
sunnyishere 2014-01-22
86580599 2019-09-23
shumark 2014-05-29
爱好HtmlCssJs 2019-10-28
shumark 2014-07-07
AngelicaA 2015-03-14
81751330 2015-03-10
kentrl 2016-05-03
Qc 2020-07-19
swiftwwj 2020-07-05