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

                          }

             });

        });

    });

  • 相关阅读:
    @RequestParam 加与不加的区别
    spring boot 实战
    mongo入门
    npm install 错误记录
    AsyncConfigurer 线程池
    guava Preconditions
    mysql分组、合并语句
    maven的学习以及集成开发软件
    Spring MVC+Junit测试出错---@WebAppConfiguration
    mybatis的代码生成器
  • 原文地址:https://www.cnblogs.com/handongyu/p/5150824.html
Copyright © 2011-2022 走看看