11行php+js 求改错
<script><br />function del(){<br /> if (!confirm("您确定要删除这些记录吗?已提交记录将不能删除!")){<br /> return;<br /> }<br /> document.location = "delete1.php?lmbs=<?php echo urlencode("主题管理");?>&id=<?php echo $array['id'];?>"; <br />}<br /></script>
function del(){
if (!confirm("您确定要删除这些记录吗?已提交记录将不能删除!")){
return;
}
document.location = "delete1.php?lmbs=<?php echo urlencode("主题管理");?>&id=<?php echo $array['id'];?>";
}
<br><font color="#e78608">------解决方案--------------------</font><br>上面发的还有些问题!<br><script type="text/javascript" src="js/jquery.js"></script><br><script type="text/javascript"><br />$(document).ready(function(){<br />$("#delUserById").click(function(){<br />var id = $(this).parent().find('.userId').val();<br />alert(id);<br /> if (!confirm("您确定要删除这些记录吗?已提交记录将不能删除!")){<br /> return;<br /> }<br /> document.location = "delete1.php?lmbs=<?php echo urlencode("主题管理");?>&id="+id; <br />});<br />});<br /></script><br><br><div>
<br><input type="button" id="delUserById" value="删除"><br><input class="userId" type="hidden" value="<?php echo $array['id'];?>"><br>
</div><br><br><br>只要你的$array['id']有值,应该可以获取了 <div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号