-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-ajax.html
40 lines (39 loc) · 1.14 KB
/
01-ajax.html
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
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
<html lang="en">
<head>
<title>Poem</title>
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(
function()
{
$("#getPoem").click(
function()
{
$.ajax(
{
url: "poemx.php",
success:
function(result)
{
$("#result").html(result);
},
error:
function(theError)
{
$("#result").html(theError.statusText);
}
}
);
}
);
});
</script>
</head>
<body>
<div id="result"></div>
<input type="button" id="getPoem" value="Show Poem" />
</body>
</html>