30DAY / jQuery

2017. 5. 17. 09:06

http://api.jquery.com/


자바스크립트는 실행문

ready를 쓰면 스크립트문을 위에쓸수있음


  • focus & blur
  • animate
  • toggle

DOM변경

  • append
  • remove & empty


AJAX

참고사이트

https://mvnrepository.com/




Gson gson = new Gson();

      String json = gson.toJson(list);

      System.out.println(json);

      out.println(json);




<script>

      $(document).ready(function(){

            $('button').click(function(){

                  $.get("./studentList.jsp",function(list){

                        console.log(list);-->콘솔창출력

                        $(list).each(function(index,item){

                             $('tbody').append('<tr>');

                             $('tbody').append('<td>'+item.no+'</td>');

                             $('tbody').append('<td>'+item.category+'</td>');

                             $('tbody').append('<td>'+item.title+'</td>');

                             $('tbody').append('<td>'+item.content+'</td>');

                             $('tbody').append('<td>'+item.day+'</td>');

                             $('tbody').append('</tr>');

                        });

                  });

                  });

            });

</script>

*studentList 데이터베이스 select하는 jsp



+ Recent posts