$.ajax

来源:互联网 发布:unity3d 三维城市建模 编辑:程序博客网 时间:2024/05/16 17:41

“`
.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 += ‘

’ + comment[‘username’]
+ ‘: