The href download file takes the url based on the id and downloads it

  • 2020-03-30 03:04:43
  • OfStack

Take the url by id and download it
 
<a class="url" apkids="${apk[0]}" href="javascript:void(0);">view</a> 
$(function(){ 
$(".url").click(function(){ 
var apkID=$(this).attr("apkids"); 
jQuery.ajax({ 
type:"post", 
url:"<c:url value='apkProToSign!getReportUrl.do'/>", 
data:{ apkID:apkID }, 
async:true, 
success:function(data){ 
if(data=='1'){ 
alert("No report data!"); 
}else{ 
if(data.length>0){ 
window.location.href=data; 
} 
} 
} 
}); 
}) 

}) 

Related articles: