$(function(){
$('#send').click(function(){
$.ajax({
type: "GET",
url: "test.json",
data: {username:$("#username").val(), content:$("#content").val()},
dataType: "json",
success: function(data){
$('#resText').empty(); //清空resText里面的所有内容
var html = '';
$.each(data, function(commentIndex, comment){
html += '<div class="comment"><h6>' + comment['username']
+ ':</h6><p class="para"' + comment['content']
+ '</p></div>';
});
$('#resText').html(html);
}
});
});
});

最新文章

  1. WCF学习之旅—TcpTrace工具(二十五)
  2. [转][Starling] 神器——原生Swf一键导出到Starling!
  3. java8--stream
  4. ArrayList常用方法
  5. HttpRequest 和HttpWebRequest的区别
  6. vs2013中国集
  7. Asp.net开发常用的51个非常实用的代码
  8. hash_map和map的区别
  9. erlang nif小结
  10. PatrolRobot(UVa1600)BFS
  11. c++模板两个数的加法
  12. Learning Ionic中文版本
  13. C语言程序设计第一作业
  14. 图解TCP/IP
  15. oldboy s21day11
  16. 启动tomcat出现内存溢出错误 java.lang.OutOfMemoryError: PermGen space
  17. Docker入门02——Dockerfile详解
  18. MySQL 插件CONNECTION_CONTROL和CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS
  19. 【转】Android实战技巧之四十九:Usb通信之USB Host
  20. PHP文件锁定写入实例分享

热门文章

  1. MySQL优化Explain命令简介(一)
  2. Oracle下建立dblink时的权限问题
  3. 【LG4491】[HAOI2018]染色
  4. FFT&amp;NTT总结
  5. underscore.js 分析 第四天
  6. 如何使用Win+R快捷键打开自定义程序
  7. 基于C#的机器学习--模糊逻辑-穿越障碍
  8. 简单主机批量管理工具(这里实现了paramiko 用su切换到root用户)
  9. JVM监控及堆栈内存
  10. Python爬虫入门(6):Cookie的使用