Live Brilliant

[JQuery] Ajax load 본문

개발은 핵찜이야/JQUERY

[JQuery] Ajax load

주인정 2012. 7. 5. 15:27

<html>

    <head>

        <title>jquery </title>

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

        

        <script type="text/javascript">

            

            $(document).ready(function(){

    

//get() AJAX 요청을 사용하여 서버에서 데이터, 지정된 요소로 자리 반환된 데이터

                $.get('content.php', function(data){ 

                    $('#content').html(data);

                });


            //load() AJAX 요청을 사용하여 서버에서 데이터, 지정된 요소로 반환된 데이터

                $('#button').click(function(){

                    $('#content').load('content.php #OTHER');

                });

                

            });

    </script>

    </head>

    <body>

        <h1>Ajax Load</h1>

        <div id="content">

            

        </div>

        

        <input type="submit" id="button" value="button">

        

    </body>

</html>

'개발은 핵찜이야 > JQUERY' 카테고리의 다른 글

jquery settimeout redirect  (0) 2013.06.05
jquery mobile data-ajax false[페이지 전환 문제 해결]  (0) 2013.05.31
jquery scroll 사용법  (0) 2013.05.28
li 태그 index 값 출력  (0) 2012.11.21
[JQuery] Custom function  (0) 2012.07.05
Comments