<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>邮件列表</title>
    <style>
        body{font-size: 13px;}
        li{color:#428bca;line-height: 1.5em;}
        a{text-decoration: none;margin-left: 5px;}
    </style>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>
    <a href="/index">首页</a>
    <ul>
        <% 
        var str='';
        for(var i=0,len=data.length;i<len;i++){
            str += '<li>'+data[i]+'<a href="javascript:void(0);" data-id="'+i+'" class="del">[删除]</a></li>';
        }
        %>
        <%-str%>
    </ul>
    <script>
        $(function(){
            $(".del").on("click",function(){
                $.post('/index/del',{id:$(this).attr('data-id')},function(data){
                    console.log(data);
                });
            });
        });
    </script>
</body>
</html>