• 코드:
​x
 
1
<!DOCTYPE html>
2
<html lang="ko">
3
​
4
<head>
5
    <meta charset="UTF-8">
6
    <title>jQuery Ajax Intro</title>
7
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
8
    <script>
9
        $(function() {
10
            $("#requestBtn").on("click", function() {
11
                $("#text").load("/examples/media/jquery_ajax_data.txt");
12
            });
13
        });
14
    </script>
15
</head>
16
​
17
<body>
18
​
19
    <h1>제이쿼리와 Ajax</h1>
20
    <p id="text">이 단락에 다른 텍스트를 불러와보죠!</p>
21
    <button id="requestBtn">데이터 불러오기!</button>
22
    
23
</body>
24
​
25
</html>