Jump to content

[SOLVED] Load Page - New Script


lilman

Recommended Posts

I am completely stumped at this point.  I am using IE 7 to test out my code which is below:

<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').selectedIndex;

	if(object == "1"){
	status = "Enabled";
	}
	else if(object == "2"){
		status = "Disabled";
	}	
}
else if(form == "file"){
	var object = document.getElementById('filestorage').selectedIndex;

	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>

 

The variable page alerts me of the correct URL which is: php/updateEnableDisable.php?status=Disabled&form=file or form equals photoalbum

 

Can anyone spot out why this will not work, it doesn't load the page (updateEnableDisable.php)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.