继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

发表评论,ajax异步请求

慕移动5642872
关注TA
已关注
手记 1
粉丝 1
获赞 3

<!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 src="kindeditor/kindeditor.js"></script>
<script src="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>

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP

热门评论

没有js文件,php文件啊

查看全部评论