Ok just a quick question.. after sitting here for about half an hour trying to work out what's wrong with this script i come here in seek of guidence.
<script type="text/javascript">
function initialize(){
var xmlHttp;
try{
xmlHttp = new XMLHttpRequest();
}catch (e){
try{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch (e){
try{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch (e){
alert("No ajax!");
return false;
}
}
}
}
function mail(){
initialize();
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState == 4)
{
document.getElementById("show_box").innerHTML = xmlHttp.responseText;
}
}
xmlHttp.open("GET","http://www.staticfire.co.uk/ajaxrequest.php?cmd=mail",true);
xmlHttp.send(null);
}
</script>
The problem seems to be that it isn't recognising the initialize() function. But if i replace where i call the function with the code for that function it all runs fine. Am i missing something obvious here?
-Thanks, Firefly