Home  >  Article  >  Backend Development  >  求改写删除验证 确认删除吗

求改写删除验证 确认删除吗

WBOY
WBOYOriginal
2016-06-23 13:26:021135browse

代码是 

<a href='javascript:;' onclick="showWindow('xinxi', 'index.php?&act=delete&id={$my['id']}','get',0);return false;">删除</a>


在这段信息中  加上 return('确认删除吗?')  也不能执行询问 或者询问了点否还是执行了删除

求怎么加个判断 点否 则不删除


回复讨论(解决方案)

网上的

<script> <br /> function clear1() <br /> { <br /> if(confirm("确定要清空数据吗?")) <br /> { <br /> document.main.text1.value = ""; <br /> } <br /> } <br /> </script>



  
  

confirm

参考:

<script type="text/javascript">function del(){    if(confirm('是否删除')==true){        alert('删除');        window.location = 'http://www.baidu.com';    }else{        return ;    }}</script><a href="javascript:;" onclick="del()">删除</a>

参考:

<script type="text/javascript">function del(){    if(confirm('是否删除')==true){        alert('删除');        window.location = 'http://www.baidu.com';    }else{        return ;    }}</script><a href="javascript:;" onclick="del()">删除</a>



你好,我的意思是要在我的那段代码上改下 技能实现我的那段代码的无刷新删除 又要有确认删除与否弹出

function showWindow(a, b){  if(confirm('是否删除')){    //你的操作  }  return false;}</script><a href='javascript:;' onclick="return showWindow('xinxi', 'index.php?&act=delete&id={$my['id']}','get',0)">删除</a>

<script type="text/javascript">function del(id){    if(confirm('是否删除')==true){        showWindow('xinxi', 'index.php?&act=delete&id='+id,'get',0);    }else{        return ;    }}</script><a href="javascript:;" onclick="del({$my['id']})">删除</a>

<script type="text/javascript">function del(id){    if(confirm('是否删除')==true){        showWindow('xinxi', 'index.php?&act=delete&id='+id,'get',0);    }else{        return ;    }}</script><a href="javascript:;" onclick="del({$my['id']})">删除</a>



哈哈 果然是高手!
Statement:
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