summaryrefslogblamecommitdiffstats
path: root/notFinishedCode/web/ajax.php
blob: ed8f4b6dbbb969eaab9ddb1efe11abca715e15c3 (plain) (tree)
1
2
3
4
5
6
7
8







                                                          






























































































































































                                                                                                                                                                    

<head> <title> Results page </title> <style> 
/* -------------------------------------------------------
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>