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循环的代码中添加参数?而不是加在js中。
原来是这样的:
for
{
echo '打印';
}
现在把它的参数加到1#循环代码中怎么做?
onclick="showprint('.$id.')添加部分;"
onclick="showprint('.$id.')添加部分;"
试过不行诶。有没有类似的功能:原超链接点击一次就失效?
PS,原页面有多个超链接(for循环生成,每个链接根据参数不同指向链接不同),点击链接在新窗口打开。
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>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号