JS 中使用正则replace()方法来替换 提交的评论内容含有的敏感词汇!


css 样式:

<style type="text/css">
        * {
            padding: 0;
            margin: 0;
        }

        li {
            list-style: none;
        }

        body {
            background: #eee;
        }

        #t_sina {
            width: 390px;
            padding: 10px;
            background: #fff;
            margin: 50px auto 0;
            font-size: 12px;
            border: 1px solid #ccc;
        }

        #t_sina h2 {
            padding: 10px 0 10px 10px;
            border-bottom: 1px solid #ebebeb;
            color: #333;
            font-size: 14px;
        }

        #content {
            width: 390px;
        }

        #content ul {
            width: 390px;
        }

        #content li {
            width: 390px;
            padding: 10px 0;
            overflow: hidden;
            border-bottom: 1px dotted #9f9f9f;
        }

        #content .pic {
            float: left;
            width: 50px;
            height: 50px;
        }

        #content .pic a {
            display: block;
            width: 50px;
            height: 50px;
            background: #eee;
        }

        #content .pic a:hover {
            background: #00FFFF;
        }

        #content p {
            float: right;
            width: 315px;
            margin-right: 10px;
            display: inline;
            line-height: 16px;
            color: #666;
        }

        #content p a {
            color: #6eafd5;
            font-family: arial;
            text-decoration: none;
        }

        #content p a:hover {
            text-decoration: underline;
        }

        #content p span {
            color: #999;
        }

        #t_sina dt {
            font-size: 14px;
            height: 40px;
            line-height: 40px;
        }

        #t_sina dd {
            padding-bottom: 5px;
            color: #666;
        }

        #t_sina .text {
            width: 320px;
            height: 20px;
            line-height: 20px;
            font-size: 12px;
            font-family: arial;
            color: #666;
            position: relative;
            left: 20px;
        }

        #t_sina textarea {
            width: 320px;
            height: 80px;
            line-height: 20px;
            overflow: auto;
            font-size: 12px;
            font-family: arial;
            color: #666;
            position: relative;
            left: 20px;
        }

        #t_sina .btn {
            position: relative;
            left: 55px;
            width: 120px;
            height: 30px;
        }
    </style>


JS代码:





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值