Osterling
08-04-2007, 09:28 PM
I cannot seem to get this function to load the page in Internet Explorer, but it will in Firefox. I really cannot figure this one out. It's day two of problem shooting, and I just am stumped. Below is the function.
<script>
function statusEnableDisable(page,usediv, form)
{
// Set up request varible
try {
xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Error: Could not load page.");
}
if(form == "photoalbum"){
var object = document.getElementById('photoalbum').selectedInde x;
if(object == "1"){
status = "Enabled";
}
else if(object == "2"){
status = "Disabled";
}
}
else if(form == "file"){
var object = document.getElementById('filestorage').selectedInd ex;
if(object == "1"){
status = "Enabled";
}
else if(object == "2"){
status = "Disabled";
}
}
page = page + "status=" + status;
page = page + "&form=" + form;
alert(page);
//Show page is loading
document.getElementById(usediv).innerHTML = 'Loading Page...';
//scroll to top
scroll(0,0);
//send data
xmlhttp.onreadystatechange = function(){
//Check page is completed and there were no problems.
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
//Write data returned to page
document.getElementById(usediv).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", page);
xmlhttp.send(null);
//Stop any link loading normaly
return false;
}
</script>
page alerts the correct URL which is: php/updateEnableDisable.php?status=Disabled&form=file
If anyone can spot anything that might be causing this to fail in Internet Explorer, I would appreciate the advice. Thank you
<script>
function statusEnableDisable(page,usediv, form)
{
// Set up request varible
try {
xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Error: Could not load page.");
}
if(form == "photoalbum"){
var object = document.getElementById('photoalbum').selectedInde x;
if(object == "1"){
status = "Enabled";
}
else if(object == "2"){
status = "Disabled";
}
}
else if(form == "file"){
var object = document.getElementById('filestorage').selectedInd ex;
if(object == "1"){
status = "Enabled";
}
else if(object == "2"){
status = "Disabled";
}
}
page = page + "status=" + status;
page = page + "&form=" + form;
alert(page);
//Show page is loading
document.getElementById(usediv).innerHTML = 'Loading Page...';
//scroll to top
scroll(0,0);
//send data
xmlhttp.onreadystatechange = function(){
//Check page is completed and there were no problems.
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
//Write data returned to page
document.getElementById(usediv).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", page);
xmlhttp.send(null);
//Stop any link loading normaly
return false;
}
</script>
page alerts the correct URL which is: php/updateEnableDisable.php?status=Disabled&form=file
If anyone can spot anything that might be causing this to fail in Internet Explorer, I would appreciate the advice. Thank you