[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>

 

 


-------------------------------------------------------------------------------------

 



[실행결과]


 

 

 
 

Posted by holland14
: