티스토리 뷰
Example: Send an id as data to the server, save some data to the server, and notify the user once it's complete. If the request fails, alert the user.
var menuId = $("ul.nav").first().attr("id");
var request = $.ajax({
url: "script.php",
type: "POST",
data: {id : menuId},
dataType: "html"
});
request.done(function(msg) {
$("#log").html( msg );
});
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
});
$.ajax({ url: "http://fiddle.jshell.net/favicon.png", beforeSend: function ( xhr ) { xhr.overrideMimeType("text/plain; charset=x-user-defined"); } }).done(function ( data ) { if( console && console.log ) { console.log("Sample of data:", data.slice(0, 100)); } });
상세 내용: http://api.jquery.com/jQuery.ajax/
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- java web-mvc
- 람다식(lambda expression)
- nl2br
- 스프링 시큐리티(spring security)
- 표현 언어(expression language)
- 제품 등록
- System.Diagnostics
- 스프링 프레임워크(spring framework)
- 진수 변환
- docker
- React
- java.sql
- 스프링 프레임워크(spring framewordk)
- .submit()
- jsp 오픈 소스
- system.io
- 메이븐(maven)
- java-개발 환경 설정하기
- In App Purchase
- java 키워드 정리
- 특정 문자를 기준으로 자르기
- 인텔리제이(intellij)
- jstl(java standard tag library)
- await
- REST API
- error-java
- jstl(java standard tag library)-core
- MainActor
- 스프링 시큐리티(spring security)-http basic 인증
- 문자 자르기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함