|
|
|
@ -39,27 +39,47 @@ |
|
|
|
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" \ |
|
|
|
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">" \ |
|
|
|
"<head>" \ |
|
|
|
"<title>200 - OK</title>" \ |
|
|
|
"<title>My own little Web-App</title>" \ |
|
|
|
"<style type=\"text/css\">" \ |
|
|
|
"div#randval {" \ |
|
|
|
"width: 120px;" \ |
|
|
|
"height: 30px;" \ |
|
|
|
"left: 200px;" \ |
|
|
|
"top: 100px;" \ |
|
|
|
"position: fixed;" \ |
|
|
|
"overflow: none;" \ |
|
|
|
"background-color: white;" \ |
|
|
|
"border: 1px solid black;" \ |
|
|
|
"}" \ |
|
|
|
"div.hide#randval {" \ |
|
|
|
"top: -50px;" \ |
|
|
|
"}" \ |
|
|
|
"</style>" \ |
|
|
|
"<script type=\"text/javascript\" src=\"/jquery/\"></script>" \ |
|
|
|
"<script>" \ |
|
|
|
"$(document).ready(function() {" \ |
|
|
|
"$(\"a\").click(function() {" \ |
|
|
|
"alert(\"Hello world!\");" \ |
|
|
|
"$(\"#randval\").load(\"/randval/\");" \ |
|
|
|
"$(\"#randval\").removeClass(\"hide\");" \ |
|
|
|
"});" \ |
|
|
|
"$(\"#randval\").click(function() {" \ |
|
|
|
"$(\"#randval\").addClass(\"hide\");" \ |
|
|
|
"});" \ |
|
|
|
"});" \ |
|
|
|
"</script>" \ |
|
|
|
"</head>" \ |
|
|
|
"<body>" \ |
|
|
|
"<h1>Testpage</h1>" \ |
|
|
|
"<img src=\"/image/\" />" \ |
|
|
|
"<hr />%02d" \ |
|
|
|
"<hr /><a href=\"#\">Link</a>" \ |
|
|
|
"<div id=\"randval\" class=\"hide\"></div>" \ |
|
|
|
"<div id=\"main\">" \ |
|
|
|
"<h1>Testpage</h1>" \ |
|
|
|
"<img src=\"/image/\" />" \ |
|
|
|
"<hr /><a href=\"#\">Link</a>" \ |
|
|
|
"</div>" \ |
|
|
|
"</body>" \ |
|
|
|
"</html>" |
|
|
|
|
|
|
|
|
|
|
|
HttpResponse |
|
|
|
httpResponseMe(int value) |
|
|
|
httpResponseMe() |
|
|
|
{ |
|
|
|
char buffer[200]; |
|
|
|
HttpResponse response; |
|
|
|
@ -89,9 +109,9 @@ httpResponseMe(int value) |
|
|
|
sizeof("profession=\"coder\"")-1)); |
|
|
|
|
|
|
|
message->type = HTTP_MESSAGE_BUFFERED; |
|
|
|
message->nbody = sizeof(RESP_DATA)-1-2; |
|
|
|
message->body = malloc(sizeof(RESP_DATA)-2); |
|
|
|
sprintf(message->body, RESP_DATA, value); |
|
|
|
message->nbody = sizeof(RESP_DATA)-1; |
|
|
|
message->body = malloc(sizeof(RESP_DATA)-1); |
|
|
|
memcpy(message->body, RESP_DATA, sizeof(RESP_DATA)-1); |
|
|
|
|
|
|
|
nbuf = sprintf(buffer, "%d", message->nbody); |
|
|
|
|
|
|
|
|