블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

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 31
반응형

Category

Recent Post

Recent Comment

Archive

2009. 11. 25. 10:26 .Net Project/Jquery 1.3.2
반응형
 Browser.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>브라우저 정보 얻기</title>

    <script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            var result = "";

 

            // $.browser 모든 속성 출력

            jQuery.each(jQuery.browser, function (i, val) {

                result += i + ":" + val + "\n";

            });

 

            alert(result);

 

            // 브라우저 확인 
            if ($.browser.msie) {

                alert("IE 웹 브라우저");

            }

            else {

                alert('다른 웹 브라우저');

            }

        });

    </script>

</head>

<body> 

</body>

</html> 




반응형
posted by Magic_kit
2009. 11. 25. 10:20 .Net Project/Jquery 1.3.2
반응형
jQuery.ajaxSetup.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>반복사용하는 ajax() 메서드의 주요 속성을 ajaxSetup()에서 설정</title>

    <style type="text/css">

    .yellow { background-color:Yellow; }

    .Lime { background-color:Lime; }

    </style>

    <script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            // $.ajax()서 반복 사용하는 속성을 상단에 설정 ajax     
                          상속 받아서 사용 가능하다

            $.ajaxSetup({

                url: "02.jQuery.getJSON.js",

                dataType: "json"

            });

            $.ajax({

                success: function (data) {

                    $.each(data, function () {

                        $('#tblList').append("<tr><td>" + this.Num + "</td><td>"

                            + this["Name"] + "</td></tr>");

                    });

                    $('table:first tr:odd').addClass('yellow');

                    $('table:first tr:even').addClass('Lime');    

                }

            });

            $.ajax({

                success: function (data) {

                    $.each(data, function () {

                        $('#tblList2').append("<tr><td>" + this.Num + "</td><td>"

                            + this["Name"] + "</td></tr>");

                    });

                    $('table:last tr:odd').addClass('yellow');

                    $('table:lasttr:even').addClass'Lime');                        

                }

            });

        });

    </script>

</head>

<body>

    <table id="tblList" border="1"></table>

    <table id="tblList2" border="1"></table>

</body>

</html> 


 02.jQuery.getJSON.js
[

    {

        "Num": "1",

        "Name": "홍길동"

    },

    {

        "Num": "2",

        "Name": "백두산"

    },

    {

        "Num": "3",

        "Name": "한라산"

    }

] 






반응형
posted by Magic_kit
2009. 11. 25. 10:09 .Net Project/Jquery 1.3.2
반응형
jQuery.ajax.JSON.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>getJSON() 대체하는 ajax() 메서드</title>

    <script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            // 동적으로 원격에있는 JSON파일을 로드

            $.ajax({

                url: "02.jQuery.getJSON.js", // a.aspx, a.php, a.jsp

                dataType: "json",

                success: function (data) {

                    // 받아온 JSON 테이블에 출력
                    $.each(data, function () {

                        $('#tblList').append("<tr><td>" + this.Num + "</td><td>"

                            + this["Name"] + "</td></tr>");

                    });

                    $.each(data, function (index, entry) {

                        $('#tblList').append("<tr><td>" + entry.Num + "</td><td>"

                            + entry["Name"] + "</td></tr>");

                    });

                },

                error: function () { alert("에러 발생"); }

            });

        });

    </script>

</head>

<body>

    <table id="tblList" border="1"></table>

</body>

</html> 


 02.jQuery.getJSON.js

[

    {

        "Num": "1",

        "Name": "홍길동"

    },

    {

        "Num": "2",

        "Name": "백두산"

    },

    {

        "Num": "3",

        "Name": "한라산"

    }

] 








반응형
posted by Magic_kit
2009. 11. 25. 10:08 .Net Project/Jquery 1.3.2
반응형
 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()메서드의 기능을메서드로 대체 </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> 


jQuery.ajax.js

function MessageBox(string) {

    alert(string);

} 









반응형
posted by Magic_kit