블로그 이미지
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. 13. 11:19 .Net Project/Jquery 1.3.2
반응형

- 다음 주소창에  ?Msg-JQuery 입력 후 JQuery 스트링 값 전달 

FrmResponseData.aspx OR FrmResponseData.aspx.CS 
 


<%
@ Page Language="C#" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

    Inherits="Ajax_Request_FrmResponseData" %>

 

<script runat="server">

 

    //?Msg=JQuery 값을 넘겨주면 쿼리스트링 값으로 전달
    protected void Page_Load(object sender, EventArgs e)

    {

        Response.ContentType = "text/html";

 

        string html =

               "<div>úEøc<div style=''>" +

               Request["Msg"] + "," +

               DateTime.Now.ToShortTimeString() + "<div></div>";

       

        Response.Clear();

        Response.Write(html);

        Response.End();

    }

</script>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

   

    </div>

    </form>

</body>

</html> 






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


- 버튼 클릭시 이벤트 처리


get.html
 

<!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>XML 파일 로드하기</title>

 

    <script src="../../jquery-1[1].3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("#btn").click(function () {

                $.get('04a.Company.xml', function (data){

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

                    $(data).find('Company').each(function (){

                        var $entry = $(this);

                       

                        //특성Attribute)을 읽어오기
                       var html ="<div>" + $entry.attr('CompanyType') + "</div>";

                       

                 //하위 엘리먼트 읽어오기
                 html += "<div>" + $entry.find("CompanyName").text() + "</div>";

                        $('#ctlGrid').append($(html));

                    });

                });

            });

        });      

 

    </script>

   

</head>

<body>

    <input type="button" id="btn" value="회사소개" />

    <div id="ctlGrid"></div>  

</body>

</html> 


Company.XML
 

<?xml version="1.0" encoding="utf-8" ?>

<Company CompanyTye="Private">

  <CompanyName>용원이 블로그</CompanyName>

  <CompanyNumber>1234</CompanyNumber>

  <CompanyAddress>서울</CompanyAddress>

  <CompanyAddressDetail>세울</CompanyAddressDetail>

  <Name>김용원</Name> 

</Company> 





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

 JQuery.getScript.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">

        .redColor { color:Red;}

    </style>

    <script src="../../jquery-1[1].3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("#btn").click(function () {

                //아래 코드가 실행되는 시점에 파일의 느낌 실행

                $.getScript('03a.JQuery.getScript.js');

            });

        });      

 

    </script>

    

</head>

<body>

<div>

    <input type="button" id="btn" value="표 그리기" />

   

<div id ="ctlGrid"></div>   

</div>

  

</body>

</html> 


 JQuery.getScript.JS
 

//JSON ì¡ÍII

var tableData = [

    { "Num": "1", "Name": "이준철", "Title": "안녕" },

    { "Num": "2", "Name": "김용원", "Title": "방가" },

    { "Num": "3", "Name": "주국원", "Title": "" }

];

 

var htmls = '';

 

htmls += "<table border='1'>"

htmls += "<tr><th>번호</th><th>이름</th><th>제목</th></tr>";

$.each(tableData, function () {

    htmls += "<tr>";

    htmls += "<td>" + this['Num'] + "</td>";

    htmls += "<td>" + this['Name'] + "</td>";

    htmls += "<td>" + this['Title'] + "</td>";

    htmls += "</tr>";

});

 

htmls += "</table>";

 

$('#ctlGrid').html(htmls); //ctlGrid 포함될 HTML 간격 요소  







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


 JQuery.getjSON.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>Sample Page</title>

    
    <script src="../../jquery-1[1].3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("#btn .btnLoad").click(function () {

                $.getJSON("02a.JQuery.getjSON.js", function (data) {

                    $('#pnlDisplay').empty(); //패널 내용 초기화

                    var table = "<table border='1'><tr><td>Iì|ö¨¬</td><td>ö©ª¡Ì</td><td>I¬¡×</td></tr>";

                    //data를 탐색 : each() 메서드를 사용하여 데이터 가져옴

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

                        table += '<tr>';

                        table += '<td>' + index + '</td>';

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

 

                        if (entry["Name"]) //특정 필드를 비교 할 때

                        {

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

                        }                       

                        table += '</tr>'; 

                    });

                    table += "</table>";

                  $('#pnlDisplay').append(table); //패널 추가                
                
});
 

            });

        });      

 

    </script>

   

</head>

<body>

    <div id="btn"><div class="btnLoad">HTML ¨¢úi¯A¾a</div>

    <div id="pnlDisplay"></div>

    </div>

</body>

</html>


 JQuery.getjSON.JS
 

[

    {

        "Num": "1",

        "Name": "김용원"

    },

    {

        "Num": "2",

        "Name": "홍길동"

    }

] 






반응형
posted by Magic_kit