getScript()메서드의 기능을 ajax()메서드로 대체
.NET프로그래밍/jQuery 1.3.2 2009. 11. 17. 10:06 |
[jQuery.ajax.js]
function MessageBox(string) {
alert(string);
}
-------------------------------------------------------------------------------------
[jQuery.ajax.htm]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>getScript()메서드의 기능을 ajax()메서드로 대체</title>
<script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "get",
url: "10.jQuery.ajax.js",
dataType : "script",
success : function (data) { MessageBox('안녕');},
error : function (data) { alert('에러 발생') }
});
});
</script>
</head>
<body>
</body>
</html>
-------------------------------------------------------------------------------------
[실행결과]
'.NET프로그래밍 > jQuery 1.3.2' 카테고리의 다른 글
반복사용하는 ajax() 메서드의 주요 속성을 ajaxSetup()에서 설정 (0) | 2009.11.17 |
---|---|
getJSON()을 대체하는 ajax() 메서드 (0) | 2009.11.17 |
$.ajaxSetup() 메서드 정의 (0) | 2009.11.16 |
$.ajax()의 매개변수 형태 (0) | 2009.11.13 |
jQuery Ajax 관련 API (0) | 2009.11.13 |