Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 851 Bytes

jquery.adoc

File metadata and controls

29 lines (25 loc) · 851 Bytes

자주쓰는 코드

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script  type="text/javascript">

    function requestImage (imageId) {
        var requestUrl = "/viewImage.json";

        var icon =  $("#icon");
        $.ajax({
         url : requestUrl,
         type: "POST",
         dataType :"json",
         success:function(image){
             icon.attr('src', image.src);
             icon.attr('height',image.height);
             icon.attr('width',image.width);
         },
         error:function(jqXHR, textStatus, errorThrown){
          alert("Error");
         }
        });
    }