11行php+js 求改错解决思路

WBOY
Release: 2016-06-13 13:37:56
Original
754 people have browsed it

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>




如果在document.location后加入百度网址,可以正常实现功能。
或许是js里套php哪里错了?

------解决方案--------------------
JScript code

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!