zoukankan      html  css  js  c++  java
  • js实现删除弹框确认

    JSP页面代码如下:

    <%@ page language="java" contentType="text/html; charset=UTF-8"%>
    <%@page import="java.util.List"%>
    <%@page import="com.ycy.blog.entity.Blog"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function del() { var msg ="您真的确定要删除吗? 请确认!";
    if (confirm(msg)==true){ return true; }else{
    return false; } } </script>
    </head>
    <%
        List<Blog> list = (List<Blog>) request.getAttribute("blogs");
    %>
    <body>
        <div align="center">
            <p>博客文章管理</p>
            <table width="670" height="134" border="1" cellpadding="0"
                cellspacing="0">
                <tr>
                    <td width="51">文章号</td>
                    <td width="515">文章主题</td>
                    <td width="82">操作</td>
                </tr>
                <%
                    for (int i = 0; i < list.size(); i++) {
                        Blog blog = list.get(i);
                %>
                <tr>
                    <td><%=blog.getId()%></td>
                    <td><%=blog.getTitle()%></td>
                    <td><a
                        href="/blog/servlet/BeforeEditBlogServlet?id=<%=blog.getId()%>">修改</a>|
                        <a href="/blog/servlet/DeleteBlogServlet?id=<%=blog.getId()%>"
                        onclick="return del()">删除</a>
                    </td>
                </tr>
                <%
                    }
                %>
            </table>
            <p>&nbsp;</p>
        </div>
    </body>
    </html>

  • 相关阅读:
    线程同步的方法
    为什么HashMap中key是引用类型而不是基本数据类型?为什么有了基本数据类型还有包装类型?
    使用MyBatis的mapper接口(动态代理对象)调用时的注意点
    redis的aof持久化模式
    redis的RDB持久化方式的优缺点
    快排算法
    JAVA8新特性
    NIO中Buffer的capacity,position和limit含义
    ArrayBlockingQueue与LinkedBlockingQueue对比
    写加锁但读没有加锁造成的脏读问题
  • 原文地址:https://www.cnblogs.com/yuanchaoyong/p/7007142.html
Copyright © 2011-2022 走看看