블로그 이미지
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
반응형

Category

Recent Post

Recent Comment

Archive

2009. 11. 25. 14:14 .Net Project/Jquery 1.3.2
반응형
 Memo.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>jQuery를 사용한 한줄 메모장 /title>

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

    <script type="text/javascript">

        //[1] Ajax 사용하기 위한 기본 설정 값

        $.ajaxSetup({

            type: 'post',

            dataType: 'json',

            contentType: "application/json; charset=utf-8"

        });

        //[2] 페이지 로드 또는 이벤트  처리기  등록

        $(document).ready(function () {

            DisplayData(); //데이터 출력 함수 호출
        $('#btnAdd').click(btnAdd_Click); // 버튼 클릭시

        });

        //[3] 데이터 로드

        function DisplayData() {

            $.ajax({

                url: "MemoService.asmx/GetMemos",

                cache: false,

                data: "{}", // "{page:0}"

                success: handleHtml,

                error: ajaxFailed

            });

        }

        //[3-1] 
        function handleHtml(data, status) {

            $('#ctlMemoList').empty();

            var table = "<table 
               border='1'><tr><td>
번호</td><td>이름</td><td>한줄메모</td><td>작성일</td></tr>";

            // Microsoft Ajax

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

                // 날짜 형식 변경
                var today = new Date(DateDeserialize(entry["PostDate"]));

                var month = (today.getMonth() + 1) < 10

        ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1);
  
             var day = today.getDate() < 10 ? "0" + today.getDate() : today.getDate();  

                table += '<tr>';

                table += '<td>' + entry["Num"] + '</td>';

                table += '<td>' + entry["Name"] + '</td>';

                table += '<td>' + entry["Title"] + '</td>';

                table += '<td>' + today.getFullYear() + "-" + month + "-" + day + '</td>';

                table += '</tr>';

            });

            table += "</table>";

            $('#ctlMemoList').append(table);             

        }

        //[3-2] Ajax 로드 실패시 에러 표시

        function ajaxFailed(xmlRequest) {

            alert(

                xmlRequest.status + '\r\n' + xmlRequest.statusText + '\r\n' + xmlRequest.responseText);

        }

        //[3-3] 날짜 변환 함수

        function DateDeserialize(dateStr) {

            return eval('new' + dateStr.replace(/\//g, ' '));

        }

        //[4] 데이터 저장

        function btnAdd_Click() {

            //[a] 데이터 받기

            var name  = $('#txtName').val();

            var email = $('#txtEmail').val();

            var title = $('#txtTitle').val();

            //[b] 유효성 검사 : 또 다른 플러그인 검색  

            if (name.length == 0) {

                alert("이름을 입력하시오 "); return;

            }

            //[c] JSON 형태로 넘길 문자열 묶기

            var postVal = "{name:\"" + name + "\", email:\"" + email + "\", title:\"" + title + "\"}";

            //[d] Ajax 전송

            $.ajax({

                url: "MemoService.asmx/AddMemo",

                data: postVal,

                success: function (data) {

                    alert('저장완료');

                    $('#txtName').val('');

                    $('#txtEmail').val("");

                    $('#txtTitle').val('');

                }

            });           

        }

    </script>

</head>

<body>

    <h3>한줄메모장 </h3>

    이름 : <input id="txtName" type="text" />

    이메일: <input id="txtEmail" type="text" />

    메모 : <input id="txtTitle" type="text" />

    <input id="btnAdd" type="button" value="메모 남기기" />

    <hr />

    <div id="ctlMemoList">여기에 메모리스트 출력</div>

</body>

</html> 


 MemoBasic.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>jQuery를 사용한 메모장 출력</title>

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

    <script type="text/javascript">

       

        $.ajaxSetup({

            type: 'post',

            dataType: 'json',

            contentType: "application/json; charset=utf-8"

        });

               $(document).ready(function () {

            DisplayData();         });

         function DisplayData() {

            $.ajax({

                url: "MemoService.asmx/GetMemos",

                cache: false,

                data: "{}", // "{page:0}"

                success: handleHtml,

                error: ajaxFailed

            });

        }

              function handleHtml(data, status) {

            $('#ctlMemoList').empty();

            var table = "<table border='1'><tr><td>번호</td><td>이름</td><td>한줄메모
</td><td>작성일</td></tr>";

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

                // 날짜 형식 변경

                var today = new Date(DateDeserialize(entry["PostDate"]));

                var month = (today.getMonth() + 1) < 10

                    ? "0" + (today.getMonth() + 1) :
                     (today.getMonth() + 1); 
          
              
var day = today.getDate() < 10 ? "0" +
                         today.getDate() : today.getDate(); 
           

 

                table += '<tr>';

                table += '<td>' + entry["Num"] + '</td>';

                table += '<td>' + entry["Name"] + '</td>';

                table += '<td>' + entry["Title"] + '</td>';

                table += '<td>' + today.getFullYear() + "-" + month + "-" + day + '</td>';

                table += '</tr>';

            });

            table += "</table>";

            $('#ctlMemoList').append(table);             

        }

           function ajaxFailed(xmlRequest) {

            alert(

                xmlRequest.status + '\r\n' + xmlRequest.statusText + '\r\n' + xmlRequest.responseText);

        }

       

        function DateDeserialize(dateStr) {

            return eval('new' + dateStr.replace(/\//g, ' '));

        }

       

        function btnAdd_Click() {

                       var name  = $('#txtName').val();

            var email = $('#txtEmail').val();

            var title = $('#txtTitle').val();

            if (name.length == 0) {

                alert("이름을 입력하시오."); return;

            }

            var postVal = "{name:\"" + name + "\", email:\"" +
                             email +
"\", title:\"" + title + "\"}";

            //[d] 전송

            $.ajax({

                url: "MemoService.asmx/AddMemo",

                data: postVal,

                success: function (data) {

                    alert('저장완료');

                    $('#txtName').val('');

                    $('#txtEmail').val("");

                    $('#txtTitle').val('');

                    DisplayData(); // 재로드                }

            });           

        }

    </script>

</head>

<body>

    <h3>한줄메모장</h3>

    이름 : <input id="txtName" type="text" />

    이메일 : <input id="txtEmail" type="text" />

    메모 : <input id="txtTitle" type="text" />

    <input id="btnAdd" type="button" value="¬¨­¬©£ ø©÷¾a¾a" />

    <hr />

    <div id="ctlMemoList">기에 메모리스트 출력</div>

</body>

</html>

 


MemoPager.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>jQuery를 사용한 한줄 메모장 </title>

    <link href="pagedtable.css" rel="stylesheet" type="text/css" />

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

    <script src="pagedtable.js" type="text/javascript"></script>

    <script type="text/javascript">

        $.ajaxSetup({

            type: 'post',

            dataType: 'json',

            contentType: "application/json; charset=utf-8"

        });

       

        $(document).ready(function () {

            DisplayData(); 
            $('#btnAdd').click(btnAdd_Click); 

        });

       

        function DisplayData() {

            $.ajax({

                url: "MemoService.asmx/GetMemos",

                cache: false,

                data: "{}", // "{page:0}"

                success: handleHtml,

                error: ajaxFailed

            });

        }

            function handleHtml(data, status) {

            $('#ctlMemoList').empty();

            var table =

                "<table border='1'><thead><tr><th>번호</th><th>이름</th><th>작성일</th></tr></thead>";

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

                //날짜 형식 변경

                var today = new Date(DateDeserialize(entry["PostDate"]));

                var month = (today.getMonth() + 1) < 10

                    ? "0" + (today.getMonth() + 1) :
                       (today.getMonth() + 1);
         
                
var day = today.getDate() < 10 ? "0" +
                       today.getDate() : today.getDate();
//
I           

 

                table += '<tr class="search' + entry["Num"] + '">';

                table += '<td>' + entry["Num"] + '</td>';

                table += '<td>' + entry["Name"] + '</td>';

                table += '<td>' + today.getFullYear()
                          +
"-" + month + "-" + day + '</td>';

                table += '</tr>';

 

                var tt = '<div id="tooltip-layer' + entry["Num"]

                    + '" style="display:none;width:200px;height:100px;'

                    + 'border:1px solid gray;background-color:white;">'

                    + entry["Title"] + '</div>';

                $('#ctlTooltip').append(tt); //

               

            });

            table += "</table>";

            $('#ctlMemoList').append(table);

 

            //[!] 페이징 처리의 기본은 ('').pageable();

            $('table:eq(0)').pageable({

                limit: 2, //

                pagelimit: 10, 
                started: 1 
            });

 

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

                // 툴팁을 띄어보자

                $(".search" + entry["Num"]).mouseover(function (e) {

                    $(this).mousemove(function (e) {

                        $(this).css("cursor", "hand");

                        var t = e.clientY - 15; // 상단에 표시

                        var l = e.clientX + 20; //                        

                        $("#tooltip-layer" + entry["Num"])

                            .css({ "top": t, "left": l, "position":
                                    "absolute", "opacity": "0.8" })

                            .show();

                    });

                });

                $(".search" + entry["Num"]).mouseout(function () {

                    $("#tooltip-layer" + entry["Num"]).hide();

                });

            }); 

                         

        }

           function ajaxFailed(xmlRequest) {

            alert(

                xmlRequest.status + '\r\n' + xmlRequest.statusText + '\r\n' + xmlRequest.responseText);

        }

            function DateDeserialize(dateStr) {

            return eval('new' + dateStr.replace(/\//g, ' '));

        }

             function btnAdd_Click() {

          
            var name  = $('#txtName').val();

            var email = $('#txtEmail').val();

            var title = $('#txtTitle').val();

       
            if (name.length == 0) {

                alert("이름을 입하시오."); return;

            }

           

            var postVal = "{name:\"" + name + "\",
                            email:\""
+ email + "\", title:\"" + title + "\"}";

         

            $.ajax({

                url: "MemoService.asmx/AddMemo",

                data: postVal,

                success: function (data) {

                    alert('저장완료');

                    $('#txtName').val('');

                    $('#txtEmail').val("");

                    $('#txtTitle').val('');

                    DisplayData(); // c ¤Iìa

                }

            });           

        }

    </script>

</head>

<body>

    <h3>한줄 메모장</h3>

    이름 : <input id="txtName" type="text" />

    이메일 : <input id="txtEmail" type="text" />

    메모 : <input id="txtTitle" type="text" />

    <input id="btnAdd" type="button" value="메모 남기기" />

    <hr />

    <div id="ctlMemoList">여긱에 메모 리스트 출력</div>

    <div id="ctlTooltip"></div>

</body>

</html>

 


 MemoTooltip.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>jQuery 사용한 한줄 메모장 </title>

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

    <script type="text/javascript">

       

        $.ajaxSetup({

            type: 'post',

            dataType: 'json',

            contentType: "application/json; charset=utf-8"

        });

      
        $(document).ready(function () {

            DisplayData();

            $('#btnAdd').click(btnAdd_Click); 
        });

      
        function DisplayData() {

            $.ajax({

                url: "MemoService.asmx/GetMemos",

                cache: false,

                data: "{}", // "{page:0}"

                success: handleHtml,

                error: ajaxFailed

            });

        }

      
        function handleHtml(data, status) {

            $('#ctlMemoList').empty();

            var table = "<table border='1'><tr><td>번호</td><td>이름</td><td>작성일</td></tr>";

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

               
                var today = new Date(DateDeserialize(entry["PostDate"]));

                var month = (today.getMonth() + 1) < 10

                    ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1); //

                var day = today.getDate() < 10 ? "0" + today.getDate() : today.getDate();            

 

                table += '<tr class="search' + entry["Num"] + '">';

                table += '<td>' + entry["Num"] + '</td>';

                table += '<td>' + entry["Name"] + '</td>';

                table += '<td>' + today.getFullYear() + "-" + month + "-" + day + '</td>';

                table += '</tr>';

 

                var tt = '<div id="tooltip-layer' + entry["Num"]

                    + '" style="display:none;width:200px;height:100px;'

                    + 'border:1px solid gray;background-color:white;">'

                    + entry["Title"] + '</div>';
                   
$('#ctlTooltip').append(tt); //

               

            });

            table += "</table>";

            $('#ctlMemoList').append(table);

 

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

               

                $(".search" + entry["Num"]).mouseover(function (e) {

                    $(this).mousemove(function (e) {

                        $(this).css("cursor", "hand");

                        var t = e.clientY - 15; //

                        var l = e.clientX + 20; //                         

                        $("#tooltip-layer" + entry["Num"])

                            .css({ "top": t, "left": l,
                             
"position": "absolute", "opacity": "0.8" })

                            .show();

                    });

                });

                $(".search" + entry["Num"]).mouseout(function () {

                    $("#tooltip-layer" + entry["Num"]).hide();

                });

            }); 

                        

        }

        
        function ajaxFailed(xmlRequest) {

            alert(

                xmlRequest.status + '\r\n' + xmlRequest.statusText + '\r\n' + xmlRequest.responseText);

        }

       

        function DateDeserialize(dateStr) {

            return eval('new' + dateStr.replace(/\//g, ' '));

        }

            function btnAdd_Click() {

         
            var name  = $('#txtName').val();

            var email = $('#txtEmail').val();

            var title = $('#txtTitle').val();

           
            if (name.length == 0) {

                alert("이름을 입력하시오."); return;

            }

           

            var postVal = "{name:\"" + name + "\",
                            email:\""
+ email + "\", title:\"" + title + "\"}";

           

            $.ajax({

                url: "MemoService.asmx/AddMemo",

                data: postVal,

                success: function (data) {

                    alert('저장완료');

                    $('#txtName').val('');

                    $('#txtEmail').val("");

                    $('#txtTitle').val('');

                    DisplayData(); //재로드
                 }

            });           

        }

    </script>

</head>

<body>

    <h3>한줄 메모장 </h3>

    이름 : <input id="txtName" type="text" />

    이메일 : <input id="txtEmail" type="text" />

    메모 : <input id="txtTitle" type="text" />

    <input id="btnAdd" type="button" value="메모 남기기" />

    <hr />

    <div id="ctlMemoList">여기에 메모 리스트 출력</div>

    <div id="ctlTooltip"></div>

</body>

</html>









반응형
posted by Magic_kit
2009. 11. 25. 13:44 .Net Project/Jquery 1.3.2
반응형


 Uploadify.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>파일 업로드 : jQuery + Uploadify + ASP.NET</title>

    <link href="uploadify.css" rel="stylesheet" type="text/css" />

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

    <script src="jquery.uploadify.v2.1.0.js" type="text/javascript"></script>

    <script src="swfobject.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

        $('#fileInput').uploadify({

                'uploader': 'uploadify.swf', // Uploadify 컨트롤 지정

                'script': 'uploadify.ashx',  // 스크립트 ASP.NET, ASP, PHP, JSP

                'cancelImg': 'cancel.png',   // 취소 이미지

                'auto': false, // true 파일 선택시 바로 자동으로 업로드 됨

                'folder': '/Uploads', //업로드 할 폴더 : 가상 디렉터리 + 업로드 폴더

                // 업로드 완료 시 처리

                // 주요 속성은...  
                
http://www.uploadify.com/documentation/ uÆi

                'onComplete': function (event, queueID, fileObj, response, data) {

                    $('#lblFile').append(

                    '<a href="/WebJQuery' + fileObj.filePath + '">'

                    + fileObj.name + '</a><br>');

                }

            });

            // 버튼 클릭시 업로드

            $('#btn').click(function () { $('#fileInput').uploadifyUpload(); });

        });

    </script>

</head>

<body>

    <input id="fileInput" name="fileInput" type="file" />

    <input type="button" id="btn" value="업로드" />

    <div id="lblFile"></div>

</body>

</html> 




반응형
posted by Magic_kit
2009. 11. 25. 13:39 .Net Project/Jquery 1.3.2
반응형
 Rotator.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>

    <style type="text/css">

        .divHeight { height:130px; }

    </style>

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

    <script src="jquery.rotator.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $('#rotator1').rotator({ms:3000});

        });

    </script>

</head>

<body>

    <div id="rotator1"

        style="height: 130px; width:100px; overflow: hidden; border:1px solid red;">

        <div class="divHeight">

            <img src="../../ProductImages/thumbs/BOOK-01.jpg" /><br />

            좋은책
        </div>

        <div class="divHeight">

            <img src="../../ProductImages/thumbs/COM-01.jpg" /><br />

            좋은 컴퓨터
        </div>

    </div>

</body>

</html> 




반응형
posted by Magic_kit
2009. 11. 25. 13:36 .Net Project/Jquery 1.3.2
반응형


 Carrousel.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>

    <link href="jquery.infinite-carousel.css" rel="stylesheet" type="text/css" />

    <link href="periscope-theme-switcher.css" rel="stylesheet" type="text/css" />

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

    <script src="jquery.infinite-carousel.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $('#slider-stage').carousel('#previous', '#next');

        });

    </script>

</head>

<body>

<div id="sliderBloc">

    <a id="previous">이전</a>

    <div style="" id="slider-stage">

        <div style="width: 512px;" id="slider-list">

            <a class="theme">

                <img src="../../ProductImages/BOOK-01.jpg"

                    alt="좋은책" height="120" width="120" />                

                <span class="nameVignette">좋은 책</span>

                <span class="changeTheme">조은 책</span>

            </a>

            <a class="theme">

                <img src="../../ProductImages/COM-01.jpg"

                    alt="좋은 컴퓨터" height="120" width="120" />                

                <span class="nameVignette">좋은 컴퓨터 </span>

                <span class="changeTheme">조은 컴퓨터</span>

            </a>

        </div>

    </div>

    <a id="next">다음</a>

</div>

</body>

</html> 



반응형
posted by Magic_kit