Hi,
Have the following script that works fine on first load
but if i refresh the page i get
[object Error]
page that calls AJAX func
AJAX.js script
PAGE.asp just has a response.write ("hello")
Have the following script that works fine on first load
but if i refresh the page i get
[object Error]
page that calls AJAX func
Code:
<script type="text/javascript" src="AJAX.js"></script>
<!--start cal-->
<div id="cal">
</div>
<!--end cal-->
<script type="text/javascript">
sndSORT();
</script>
AJAX.js script
Code:
<!--
// Written by Dexter Zafra at [URL unfurl="true"]www.ex-designz.net[/URL]
//Handle Check Username Availability Using Ajax
var http = createRequestObjectHIT();
function createRequestObjectHIT()
{
var xmlhttp;
try
{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(f) { xmlhttp=null; }
}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined")
{
xmlhttp=new XMLHttpRequest();
}
return xmlhttp;
}
function sndSORT()
{
try
{
http.open('GET', 'PAGE.asp');
http.onreadystatechange = handleResponseTextSORT;
http.send(null);
}
catch(e){}
finally{}
}
function handleResponseTextSORT()
{
try
{
if((http.readyState == 4)&& (http.status == 200))
{
var response = http.responseText;
var grnelement = document.getElementById('cal');
grnelement.innerHTML = response;
}
}
catch(e){alert(e);}
finally{}
}
PAGE.asp just has a response.write ("hello")