<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>rodsdot.com :: simulation of client communication with web service</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005, 2006 Roderick Divilbiss">
<script type="text/javascript">
var sending=false;
//create the Cross-browser XMLHttpRequest object
function getFile(pURL,pSend) {
alert('Sending a request to rodsdot.com for userid: '+pSend);
//if (!sending) {
if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
xmlhttp=new XMLHttpRequest();
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType('text/xml');
}
xmlhttp.onreadystatechange=postFileReady;
xmlhttp.open("GET", pURL+'?userid='+pSend, true);
xmlhttp.send(null);
} else if (window.ActiveXObject) { //IE
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
if (xmlhttp) {
xmlhttp.onreadystatechange=postFileReady;
xmlhttp.open('GET', pURL+'?userid='+pSend, false);
xmlhttp.send();
}
}
}
// function to handle asynchronus call
function postFileReady() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200) {
document.getElementById('theExample').innerHTML=xmlhttp.responseText;
}
}
}
</script>
</head>
<body>
<div id="theExample">The web site messages will appear here...</div>
<p><select size="1" name="userid" id="userid">
<option>Select name to send</option>
<option value="rdivilbiss">rdivilbiss</option>
<option value="alangsk">alangsk</option>
<option value="joesmoe">joesmoe</option>
<option value="unknown">unknown</option>
</select>
<input type="button" value="Send Request" onclick="getFile('http://www.domain.com/page.asp',document.getElementById('userid')[document.getElementById('userid').selectedIndex].value)"</p>
</body>
</html>
Client Side Includes Using JavaScript
Creating A JavaScript Slider Input in JavaScript
Creating Conditional Links With ASP
Dynamically Adding Rows and Fields To A Table Based Form
Geo-Coding IP Addresses
How To Make A Pop Over Menu
JavaScript Date Validation DD/MM/YYYY
JavaScript Date Validation MM/DD/YYYY
Parameterized SQL Using Multiple Form Inputs and Filtering
Play A WAV File On Mouseover
Pop Over Form
Resorting A Multi-Dimensional Table Using Client-Side JavaScript
Scripting Remote Images in JavaScript
Using AJAX to Return HTML For Dynamic Forms
Using Images For CAPTCHA
Using Parameterized SQL with ASP and MS Access
Why JavaScript As The HREF Of A Link Is Bad