Okay, I decided to change it a little.
so the structure, for reference, is indexTst.html -> one of those floating boxes made with CSS -> processTst2.php
IndexTst.html code:
HTML Code:
<form action="processTst2.php" method="POST" name="queryform">
stuff
<input type="submit" onClick="getContent()">
</form>
<div id="wait" style="background-color:white;position:absolute;top:240px;left:360px;width:70px;height:50px;visibility:hidden;border: 1px solid black;padding:20px;">
<img src="images/wait.gif" style="position:relative;top:0px;left:25px"><br /><br />Please wait...</div>
Here's my javascript code:
Code:
var request;
function getHTTPObject()
{
var xhr = false;
if (window.XMLHttpRequest)
{
xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try
{
xhr = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
xhr = false;
}
}
}
return xhr;
}
function getContent()
{
request = getHTTPObject();
request.onreadystatechange = sendData;
request.open("POST", "processTst2.php", true);
request.send(null);
}
function sendData()
{
if (http.readyState == 4) {
document.getElementById('wait').style.visibility = "hidden";
alert('The server script has now completed');
window.location = "processTst2.php";
} else {
document.getElementById('wait').style.visibility = "visible";
}
}
The odd thing is that it does redirect and process2.php works fine. Thoughts?
Bookmarks