1.页面
<div class="cl pd-5 bg-1 bk-gray mt-10">
<input type="hidden" value="${contract.viewpdf_url}" id="contract-btn">
<a onclick="sing_view()" class="btn btn-warning radius ml-20 mr-20">查看合同</a> 之前用的button,总是报错
<a href="${contract.download_url}" class="btn btn-warning radius ml-20 mr-20">下载合同</a>
</div>
2.js
function sing_view(){
var href=$("#contract-btn").val();
console.log(href);
var index = layer.open({
type : 2,
title : '合同查看',
content : href,
area : ['90%', '90%'],
shadeClose : false,
shade : 0.8,
cancel : function() {
}
});
}