将参数带入网页
for(condition)
{
echo '<a type="button" class="print" onclick="showprint(this)添加部分;" target="_blank">打印</a>';
}
<script language = "javascript">
function showprint(obj){
obj.removeAttribute("href");
obj.onclick=null;
obj.style.textDecoration= 'none ';
window.open("a.php?url=","_blank");
}
</script>
for(condition)
{
echo '<a type="button" class="print" onclick="showprint(this,\''.$id.'\')添加部分;" target="_blank">打印</a>';
}
<script language = "javascript">
function showprint(obj,id){
obj.removeAttribute("href");
obj.onclick=null;
obj.style.textDecoration= 'none ';
window.open("a.php?url="+id,"_blank");
}
</script>