G
garth
I am having a problem getting the responseText from my HTTPRequestXml
object into my DIV... It works in IE, but in Firefox... nothing! Here
is the code for the page:
<!-- #include file="functions.asp" -->
<!-- #include file="inc_verytop.asp" -->
<%openDB%>
<html>
<head>
<title><%=GetText("Title",lan)%></title>
<script type="text/javascript" language="javascript">
<!--
var http = false;
function doMemberSearch(sString) {
if (sString.length >= 3) {
// document.all.pleasewaitScreen.style.pixelTop =
(document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout("ajaxMemberSearch('" + sString + "')",1)
} else {
document.getElementById('searchResults').innerHTML =
"";
}
}
function ajaxMemberSearch(sString) {
// if (sString.length >= 3) {
//document.all.pleasewaitScreen.style.pixelTop =
(document.body.scrollTop + 50);
if(navigator.appName == "Microsoft Internet Explorer") {
http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
http = new XMLHttpRequest();
}
params = "ss=" + sString;
if (!http) {
//document.all('formcheck').submit();
//return false;
}
http.open("POST", "member_results.asp", true);
http.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
http.setRequestHeader("Content-length", params);
http.setRequestHeader("Connection", "close");
http.send(params);
http.onreadystatechange = MoveOn('searchResults');
// } else {
// document.getElementById('mem_content').innerHTML =
"";
// }
}
function MoveOn(sElement) {
if (http.readyState == 4) {
//if (http.status == 200) {
//alert(http.responseText);
result = http.responseText;
document.getElementById(sElement).innerHTML =
result;
document.all.pleasewaitScreen.style.visibility="hidden";
//} else {
//document.all('formcheck').submit();
//}
}
}
function validObject(objToTest) {
if (objToTest == null || objToTest == undefined) {
return false;
} else {
return true;
}
}
// -->
</script>
<link rel="Stylesheet" text/css" href="style.css" TITLE="Style">
</head>
<body>
<!-- #include file="inc_top.asp" -->
<table cellpadding="0" cellspacing="0"
border="0" style="width: 790px;" align="center">
<tr>
<td valign="top" style="padding-
right: 5px;">
<table cellpadding="0"
cellspacing="0" border="0" style="height: 100px; width: 190px;"
align="center" class="TopMenu">
<tr>
<td valign="top"
style="height: 8px;"><img src="images/gr_topleft.gif" border="0" /></
td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topspace.gif" border="0"
width="174px" height="8" /></td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topright.gif" border="0" /></
td>
</tr>
<tr>
<td valign="top"
align="left" colspan="3" style="background: #f9f9f9 top; border-left:
1px #8e8d8d solid; border-right: 1px #8e8d8d solid; line-height: 16px;
padding-bottom:2px; padding-left:5px; padding-right:5px; height:
100%;">
<a
href="javascript:doDetails('read');" title="<%=GetText("Details",lan)
%>"><%=GetText("Details",lan) %></a><br />
<a
href="javascript:doPassword('edit');" title="<
%=GetText("Password",lan) %>"><%=GetText("Password",lan) %></a>
</td>
</tr>
<tr>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomleft.gif" border="0" /
style="height: 8px;"><img src="images/gr_bottomspace.gif" border="0"
width="174px" height="8" /></td>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomright.gif" border="0" /
</table>
</td>
<td valign="top">
<table cellpadding="0"
cellspacing="0" border="0" style="height: 100px; width: 595px;"
align="center" id="holdingTable">
<tr>
<td valign="top"
style="height: 8px;"><img src="images/gr_topleft.gif" border="0" /></
td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topspace.gif" border="0"
width="579px" height="8" /></td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topright.gif" border="0" /></
td>
</tr>
<tr>
<td valign="top"
align="left" colspan="3" style="background: #f9f9f9 top; border-left:
1px #8e8d8d solid; border-right: 1px #8e8d8d solid; line-height: 16px;
padding-bottom:2px; padding-left:5px; padding-right:5px; height:
100%;">
<div
id="container" style="position:relative;">
<DIV
ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;top:20px;left:
38%;visibility:hidden">
<TABLE BORDER="0"
CELLPADDING="0" cellspacing="2" HEIGHT="40px" WIDTH="120px"
ID="pleasewaitTable" style="background-color: #ffffff;">
<TR>
<TD WIDTH="100%"
HEIGHT="100%" BGCOLOR="#c0c0c0" ALIGN="CENTER" VALIGN="MIDDLE"
class="PleaseWait">
<img
id="progressgif" src="images/progress.gif" alt="" /><br />
Please Wait
</TD>
</TR>
</TABLE>
</DIV>
<div
id="mem_content" style="display: block;">
<input
type="text" style="width: 250px;" name="membersearchtext"
id="membersearchtext"
onkeyup="javascript:doMemberSearch(this.value);" /></br>
<div
id="searchResults" style="display: block;">
</div>
</div>
</div>
</td>
</tr>
<tr>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomleft.gif" border="0" /
style="height: 8px;"><img src="images/gr_bottomspace.gif" border="0"
width="579px" height="8" /></td>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomright.gif" border="0" /
</table>
</td>
</tr>
</table>
<!-- #include file="inc_bottom.asp" -->
</body>
</html>
<%closeDB%>
object into my DIV... It works in IE, but in Firefox... nothing! Here
is the code for the page:
<!-- #include file="functions.asp" -->
<!-- #include file="inc_verytop.asp" -->
<%openDB%>
<html>
<head>
<title><%=GetText("Title",lan)%></title>
<script type="text/javascript" language="javascript">
<!--
var http = false;
function doMemberSearch(sString) {
if (sString.length >= 3) {
// document.all.pleasewaitScreen.style.pixelTop =
(document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout("ajaxMemberSearch('" + sString + "')",1)
} else {
document.getElementById('searchResults').innerHTML =
"";
}
}
function ajaxMemberSearch(sString) {
// if (sString.length >= 3) {
//document.all.pleasewaitScreen.style.pixelTop =
(document.body.scrollTop + 50);
if(navigator.appName == "Microsoft Internet Explorer") {
http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
http = new XMLHttpRequest();
}
params = "ss=" + sString;
if (!http) {
//document.all('formcheck').submit();
//return false;
}
http.open("POST", "member_results.asp", true);
http.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
http.setRequestHeader("Content-length", params);
http.setRequestHeader("Connection", "close");
http.send(params);
http.onreadystatechange = MoveOn('searchResults');
// } else {
// document.getElementById('mem_content').innerHTML =
"";
// }
}
function MoveOn(sElement) {
if (http.readyState == 4) {
//if (http.status == 200) {
//alert(http.responseText);
result = http.responseText;
document.getElementById(sElement).innerHTML =
result;
document.all.pleasewaitScreen.style.visibility="hidden";
//} else {
//document.all('formcheck').submit();
//}
}
}
function validObject(objToTest) {
if (objToTest == null || objToTest == undefined) {
return false;
} else {
return true;
}
}
// -->
</script>
<link rel="Stylesheet" text/css" href="style.css" TITLE="Style">
</head>
<body>
<!-- #include file="inc_top.asp" -->
<table cellpadding="0" cellspacing="0"
border="0" style="width: 790px;" align="center">
<tr>
<td valign="top" style="padding-
right: 5px;">
<table cellpadding="0"
cellspacing="0" border="0" style="height: 100px; width: 190px;"
align="center" class="TopMenu">
<tr>
<td valign="top"
style="height: 8px;"><img src="images/gr_topleft.gif" border="0" /></
td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topspace.gif" border="0"
width="174px" height="8" /></td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topright.gif" border="0" /></
td>
</tr>
<tr>
<td valign="top"
align="left" colspan="3" style="background: #f9f9f9 top; border-left:
1px #8e8d8d solid; border-right: 1px #8e8d8d solid; line-height: 16px;
padding-bottom:2px; padding-left:5px; padding-right:5px; height:
100%;">
<a
href="javascript:doDetails('read');" title="<%=GetText("Details",lan)
%>"><%=GetText("Details",lan) %></a><br />
<a
href="javascript:doPassword('edit');" title="<
%=GetText("Password",lan) %>"><%=GetText("Password",lan) %></a>
</td>
</tr>
<tr>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomleft.gif" border="0" /
<td valign="bottom"</td>
style="height: 8px;"><img src="images/gr_bottomspace.gif" border="0"
width="174px" height="8" /></td>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomright.gif" border="0" /
</tr></td>
</table>
</td>
<td valign="top">
<table cellpadding="0"
cellspacing="0" border="0" style="height: 100px; width: 595px;"
align="center" id="holdingTable">
<tr>
<td valign="top"
style="height: 8px;"><img src="images/gr_topleft.gif" border="0" /></
td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topspace.gif" border="0"
width="579px" height="8" /></td>
<td valign="top"
style="height: 8px;"><img src="images/gr_topright.gif" border="0" /></
td>
</tr>
<tr>
<td valign="top"
align="left" colspan="3" style="background: #f9f9f9 top; border-left:
1px #8e8d8d solid; border-right: 1px #8e8d8d solid; line-height: 16px;
padding-bottom:2px; padding-left:5px; padding-right:5px; height:
100%;">
<div
id="container" style="position:relative;">
<DIV
ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;top:20px;left:
38%;visibility:hidden">
<TABLE BORDER="0"
CELLPADDING="0" cellspacing="2" HEIGHT="40px" WIDTH="120px"
ID="pleasewaitTable" style="background-color: #ffffff;">
<TR>
<TD WIDTH="100%"
HEIGHT="100%" BGCOLOR="#c0c0c0" ALIGN="CENTER" VALIGN="MIDDLE"
class="PleaseWait">
<img
id="progressgif" src="images/progress.gif" alt="" /><br />
Please Wait
</TD>
</TR>
</TABLE>
</DIV>
<div
id="mem_content" style="display: block;">
<input
type="text" style="width: 250px;" name="membersearchtext"
id="membersearchtext"
onkeyup="javascript:doMemberSearch(this.value);" /></br>
<div
id="searchResults" style="display: block;">
</div>
</div>
</div>
</td>
</tr>
<tr>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomleft.gif" border="0" /
<td valign="bottom"</td>
style="height: 8px;"><img src="images/gr_bottomspace.gif" border="0"
width="579px" height="8" /></td>
<td valign="bottom"
style="height: 8px;"><img src="images/gr_bottomright.gif" border="0" /
</tr></td>
</table>
</td>
</tr>
</table>
<!-- #include file="inc_bottom.asp" -->
</body>
</html>
<%closeDB%>