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

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

WBOY
Release: 2016-06-23 13:26:02
Original
1145 people have browsed it

代码是 

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


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

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


回复讨论(解决方案)

网上的







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>
Copy after login
Copy after login

参考:

<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>
Copy after login
Copy after login



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

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>
Copy after login

<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>
Copy after login
Copy after login

<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>
Copy after login
Copy after login



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