为了账号安全,请及时绑定邮箱和手机立即绑定

发表评论,ajax异步请求

标签:
PHP

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>评论</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<style>

show{ background:pink;padding:10px 20px; width:761px;margin:10px auto; border-radius:6px;}
  #show p{ margin:6px; font-size:13px; line-height:22px; border-bottom:1px dashed #666666;} 
</style>
<script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="kindeditor/kindeditor.js"></script>
<script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="kindeditor/jquery-1.4.js"></script>
<body>
  <form action="sent.php" method="post">
    <table align="center" style="background:#00ff99" width="800px">
      <tr>
        <th>用户评论</th>
      </tr>
      <tr>
        <td>
                          用户名:<input type="text" name="name"  id="name" required/>
        </td>
      </tr>
      <tr>
        <td>用户评论</td>
      </tr>
      <tr>
        <td>
          <textarea name="content" id="content" requered></textarea>
        </td>
      </tr>
      <tr>
        <th>
          <input type="submit" id="input" value="发表评论"/>
          &nbsp;
          <input type="reset" value="重置"/>
        </th>
      </tr>
    </table>
  </form>
 <div id="show">
    {foreach $viewall as $v}
    <p><b style="color:#f00">&nbsp;{$v.name}</b>发表了:&nbsp;{$v.content}</p>
    {/foreach}
    <span id="span" style="color:red"></span>
  </div>
 </body>

  <script type="text/javascript"> 
  //编辑器

KindEditor.ready(function(e){
e.create("[name=content]",{
width:"750px",
height:"200px",
"items":["undo","redo","|","bold","italic","underline",'wordpaste',
'cut','|', 'justifyleft', 'justifycenter', 'justifyright',
'image',
'insertunorderedlist', 'indent', 'outdent', 'subscript']
})
});
</script>
<script>
/ if(KE.count('content','text')==""){
alert("请输入内容");
return false;
}
/

</script>
</html>

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 1
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消