Hey guys, I'm trying to make a dynamic AJAX product updater that displays products based on the brand the user selects from a form drop menu. The following function works perfectly on Safari and Firefox, but on IE I get a 'Object Expected' error and I have NO idea on how to fix it. Does anyone here know how I could go about fixing this? The function I have is below.
Thanks for the help in advance.
Code:
function updateSkinCare() {
brandName = document.getElementById('searchTypeSkin').value;
emailValue = document.getElementById('clientEmail').innerHTML;
// AJAX CALL
var PageRequest = false;
if(window.XMLHttpRequest)pageRequest = new XMLHttpRequest();
else if(window.ActiveXObject) pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
else return false;
pageRequest.onreadystatechange = function() {
if(pageRequest.readyState == 4 || pageRequest.readyState == "complete") {
document.getElementById('skincarecontent').innerHTML = pageRequest.responseText;
}
}
pageRequest.open('GET', "brandprodisplay.php?type=skincare&brand=" +brandName +"&email=" +emailValue, true);
pageRequest.send(null);
}