$(function(){
$('#send').click(function(){
$.ajax({
type : "POST",
url : "",
cache : false,
data : {username:$("#username").val(), content:$("#content").val()},
dataType : "json",
success : function(data){
$('#resText').empty();
$.each(data, function(commentIndex, comment){
html += '<div class="comment"><h6>' + comment['username']
+ ':</h6><p class="para"' + comment['content']
+ '</p></div>';
});
$('#resText').html(html);
},
error : function () {
alert("处理出错,请重新处理!");
},
complete : function(data) {
alert("处理完成");
}
});
});
});
$.ajax({
type : "POST",
url : ctx + "",
cache : false,
data : {productId : productId},
dataType : "json",
success : function(data){
},
error : function () {
},
complete : function(data) {
}
});