<标签 data-id="${knowfile.id}" href="${knowfile.fileHost}${knowfile.fileUrl}" onclick="downloadfile(${knowfile.id})" >下载</标签>
.............................................................................................
function downloadfile(id){
.............................................................................................
function downloadfile(id){
if (!confirm("是否下载?")) {
return;
}
var params = {
'id' : id
};
$.ajax({
type : 'POST',
url : '${stx }/oa/knowledge/downloadCount',
data : params,
dataType : 'json',
timeout : 5000,
context : $('body'),
success : function(data) {
var status = data.status;
if (status == 'success') {
return false;
} else {
return false;
}
},
error : function( XMLHttpRequest, textStatus, errorThrown) {
alert("服务器错误,请稍后重试!");
}
});
}
*********我用的是谷歌浏览器