...
|
...
|
@@ -39,27 +39,47 @@ |
39
|
39
|
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" \
|
40
|
40
|
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">" \
|
41
|
41
|
"<head>" \
|
42
|
|
- "<title>200 - OK</title>" \
|
|
42
|
+ "<title>My own little Web-App</title>" \
|
|
43
|
+ "<style type=\"text/css\">" \
|
|
44
|
+ "div#randval {" \
|
|
45
|
+ "width: 120px;" \
|
|
46
|
+ "height: 30px;" \
|
|
47
|
+ "left: 200px;" \
|
|
48
|
+ "top: 100px;" \
|
|
49
|
+ "position: fixed;" \
|
|
50
|
+ "overflow: none;" \
|
|
51
|
+ "background-color: white;" \
|
|
52
|
+ "border: 1px solid black;" \
|
|
53
|
+ "}" \
|
|
54
|
+ "div.hide#randval {" \
|
|
55
|
+ "top: -50px;" \
|
|
56
|
+ "}" \
|
|
57
|
+ "</style>" \
|
43
|
58
|
"<script type=\"text/javascript\" src=\"/jquery/\"></script>" \
|
44
|
59
|
"<script>" \
|
45
|
60
|
"$(document).ready(function() {" \
|
46
|
61
|
"$(\"a\").click(function() {" \
|
47
|
|
- "alert(\"Hello world!\");" \
|
|
62
|
+ "$(\"#randval\").load(\"/randval/\");" \
|
|
63
|
+ "$(\"#randval\").removeClass(\"hide\");" \
|
|
64
|
+ "});" \
|
|
65
|
+ "$(\"#randval\").click(function() {" \
|
|
66
|
+ "$(\"#randval\").addClass(\"hide\");" \
|
48
|
67
|
"});" \
|
49
|
68
|
"});" \
|
50
|
69
|
"</script>" \
|
51
|
70
|
"</head>" \
|
52
|
71
|
"<body>" \
|
53
|
|
- "<h1>Testpage</h1>" \
|
54
|
|
- "<img src=\"/image/\" />" \
|
55
|
|
- "<hr />%02d" \
|
56
|
|
- "<hr /><a href=\"#\">Link</a>" \
|
|
72
|
+ "<div id=\"randval\" class=\"hide\"></div>" \
|
|
73
|
+ "<div id=\"main\">" \
|
|
74
|
+ "<h1>Testpage</h1>" \
|
|
75
|
+ "<img src=\"/image/\" />" \
|
|
76
|
+ "<hr /><a href=\"#\">Link</a>" \
|
|
77
|
+ "</div>" \
|
57
|
78
|
"</body>" \
|
58
|
79
|
"</html>"
|
59
|
80
|
|
60
|
|
-
|
61
|
81
|
HttpResponse
|
62
|
|
-httpResponseMe(int value)
|
|
82
|
+httpResponseMe()
|
63
|
83
|
{
|
64
|
84
|
char buffer[200];
|
65
|
85
|
HttpResponse response;
|
...
|
...
|
@@ -89,9 +109,9 @@ httpResponseMe(int value) |
89
|
109
|
sizeof("profession=\"coder\"")-1));
|
90
|
110
|
|
91
|
111
|
message->type = HTTP_MESSAGE_BUFFERED;
|
92
|
|
- message->nbody = sizeof(RESP_DATA)-1-2;
|
93
|
|
- message->body = malloc(sizeof(RESP_DATA)-2);
|
94
|
|
- sprintf(message->body, RESP_DATA, value);
|
|
112
|
+ message->nbody = sizeof(RESP_DATA)-1;
|
|
113
|
+ message->body = malloc(sizeof(RESP_DATA)-1);
|
|
114
|
+ memcpy(message->body, RESP_DATA, sizeof(RESP_DATA)-1);
|
95
|
115
|
|
96
|
116
|
nbuf = sprintf(buffer, "%d", message->nbody);
|
97
|
117
|
|
...
|
...
|
|