zoukankan      html  css  js  c++  java
  • AJAX的最小单元

    $(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);

                          }

             });

        });

    });

  • 相关阅读:
    Mvc请求管道中的19个事件
    asp.net 验证正则表达式
    Asp.net MVC进入请求管道的过程
    MVC(二)
    Aspect Oriented Programming (AOP)
    在C#中??和?分别是什么意思?
    MVC(一)
    ASP.NET 管道事件与HttpModule, HttpHandler简单理解
    Entity Framework && Lambda
    扩展类和扩展方法
  • 原文地址:https://www.cnblogs.com/handongyu/p/5150824.html
Copyright © 2011-2022 走看看