summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/web/ajax.php
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/web/ajax.php')
-rw-r--r--notFinishedCode/web/ajax.php173
1 files changed, 173 insertions, 0 deletions
diff --git a/notFinishedCode/web/ajax.php b/notFinishedCode/web/ajax.php
new file mode 100644
index 0000000..c03fe8e
--- /dev/null
+++ b/notFinishedCode/web/ajax.php
@@ -0,0 +1,173 @@
+
+<head> <title> Results page </title> <style>
+/* -------------------------------------------------------
+Author: Vitaly Friedman
+Theme: Green Life - A Fresh, Warm and Readable Table
+URL: http://www.alvit.de/vf
+-------------------------------------------------------
+*/
+/* -------------------------------------------------------
+Author: Vitaly Friedman
+Theme: Green Life - A Fresh, Warm and Readable Table
+URL: http://www.alvit.de/vf
+-------------------------------------------------------
+*/
+
+ table {
+ font: 11px verdana,verdana, arial;
+ margin: 0;
+ padding: 0;
+ border-collapse: collapse;
+ text-align: left;
+ color: #333;
+ line-height: 19px;
+ }
+
+ caption {
+ font-size: 14px;
+ font-weight: bold;
+ margin-bottom: 20px;
+ text-align: left;
+ text-transform: uppercase;
+ }
+
+ td {
+ margin: 0;
+ padding: 20px 10px;
+ border: 1px dotted #f5f5f5;
+ }
+
+
+ th {
+ font-weight: normal;
+ text-transform: uppercase;
+ }
+
+ thead tr th {
+ background-color: #575757;
+ padding: 20px 10px;
+ color: #fff;
+ font-weight: bold;
+ border-right: 2px solid #333;
+ text-transform: uppercase;
+ text-align:center;
+ }
+
+ tfoot tr th, tfoot tr td {
+ background-color: transparent;
+ padding: 20px 10px;
+ color: #ccc;
+ border-top: 1px solid #ccc;
+ }
+
+ tbody tr th {
+ padding: 20px 10px;
+ border-bottom: 1px dotted #fafafa;
+ }
+
+ tr {
+ background-color: #FBFDF6;
+ }
+ tr.odd {
+ background-color: #EDF7DC;
+ }
+
+ tr:hover {
+ }
+
+ tr:hover td, tr:hover td a, tr:hover th a {
+ color: #a10000;
+ }
+
+ td:hover {
+ }
+
+ tr:hover th a:hover {
+ background-color: #F7FBEF;
+ border-bottom: 2px solid #86C200;
+ }
+
+ table a {
+ color: #608117;
+ background-image: none;
+ text-decoration: none;
+ border-bottom: 1px dotted #8A8F95;
+ padding: 2px;
+ padding-right: 12px; background: transparent url(http://www.alvit.de/vf/csstablegallery/link.gif) no-repeat 100% 50%;
+ }
+
+ table a:hover {
+ color: #BBC4CD;
+ background-image: none;
+ text-decoration: none;
+ border-bottom: 3px solid #333;
+ padding: 2px;
+ padding-right: 12px; color: #A2A2A2; background: transparent url(http://www.alvit.de/vf/csstablegallery/link.gif) no-repeat 100% 50%;
+ }
+
+ table a:visited {
+ text-decoration: none;
+ border-bottom: 1px dotted #333;
+ text-decoration: none;
+ padding-right: 12px; color: #A2A2A2; background: transparent url(http://www.alvit.de/vf/csstablegallery/visitedLink.gif) no-repeat 100% 50%;
+ }
+
+ table a:visited:hover {
+ background-image: none;
+ text-decoration: none;
+ border-bottom: 3px solid #333;
+ padding: 2px;
+ padding-right: 12px; color: #A2A2A2; background: transparent url(http://www.alvit.de/vf/csstablegallery/visitedLink.gif) no-repeat 100% 50%;
+ }
+</style>
+<html>
+<head>
+<title>Simple Ajax Example</title>
+<script language="Javascript">
+function xmlhttpPost(strURL) {
+ var xmlHttpReq = false;
+ var self = this;
+
+ // Mozilla/Safari
+ if (window.XMLHttpRequest) {
+ self.xmlHttpReq = new XMLHttpRequest();
+ }
+ // IE
+ else if (window.ActiveXObject) {
+ self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+
+ self.xmlHttpReq.open('POST', strURL, true);
+ self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ updatepage('<img src="loader.gif" alt="Loading"/>');
+ self.xmlHttpReq.onreadystatechange = function() {
+ if (self.xmlHttpReq.readyState == 3) {
+ updatepage(self.xmlHttpReq.responseText);
+ }
+ // updatepage(self.xmlHttpReq.responseText);
+ }
+ self.xmlHttpReq.send(getquerystring());
+}
+
+function getquerystring() {
+ var form = document.forms['f1'];
+ var word = form.word.value;
+ qstr = 'w=' + escape(word); // NOTE: no '?' before querystring
+ return qstr;
+}
+
+function updatepage(str){
+ document.getElementById("result").innerHTML = str;
+}
+</script>
+</head>
+<body>
+<form name="f1">
+<p>
+ word: <input name="word" type="hidden" value="ludnica?refa?tela">
+ <input value="Go" type="button" onclick='JavaScript:xmlhttpPost("/socket2.php")'></p>
+ <div id="result"></div>
+</form>
+</body>
+</html>
+