[jquery / ajax] ajax 간단하게 호출하는 방법
ajax 를 사용해서, 간단하게 컨텐츠를 호출하는 방법 <!-- 호출받을 html --><div class="ajax_inform"> </div> <!-- 호출할 html call.html --><div class="ajax_content"> </div>ajax_inform으로 call.html의 컨텐츠를 호출합니다. function callContent(){ var url = "call.html"; $.ajax({ type:"POST", url:url, dataType : "html", success: function(html){ $(".ajax_inform").html(html); }, error: function(xhr, status, error) { alert(error); } });}callContent() 를 실행하면, 아래와 같이 됩니다. <!-- 실행 후 호출받은 html --><div class="ajax_inform"> <div class="ajax_content"> </div></div>간단하게 페이지 이동없이 리스트를 갱신하거나 컨텐츠를 호출해올 수 있습니다.
calendar_today19-02-20 09:36
remove_red_eye14168
favorite_border0