JSP页面:<a href="#" onclick="sendreport('${s.waybillnumber }')" class="disableCss">发送</a>
JavaScript脚本:
<script type="text/javascript">
function sendreport(waybillnumber){
$.ajax({
'url': "${ctx}/order/report?waybillnumber="+waybillnumber,
'type':'post',
'beforeSend': function () {
$('.disableCss').removeAttr('href');//去掉a标签中的href属性
$('.disableCss').removeAttr('onclick');//去掉a标签中的onclick事件
$('.disableCss').attr("style","cursor: default;opacity: 0.2");
loading('正在处理,请稍等...');
},
'data': {"waybillnumber":waybillnumber},
'success': function(result){
alert(result);
window.location.reload();
},'error': function(){
alert("操作失败!");
}
});
}
</script>