subzerostudio Posted November 18, 2007 Share Posted November 18, 2007 Hi, I have a AJAX "product finder" script that I've written. It is working fine on the main domain: http://www.funkylittlefeet.com However does not work on the alternative domain: http://www.funkylittlefeet.co.uk Any advice on how to get it working would be appreciated. Code below. Thanks Mike var xmlHttp function changeMenu(str, menu) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="productfinder_core.php" var category = document.getElementById('occasionbox').value; var parent_cat = document.getElementById('parent_cat').value; if (category != '') { url=url+"?q="+str+"&menu="+menu+'&cat='+category } else if (parent_cat != '') { url=url+"?q="+str+"&menu="+menu+'&cat='+parent_cat+'&useParent=true' } else { url=url+"?q="+str+"&menu="+menu } url=url+"&sid="+Math.random() if (menu == 'category') { xmlHttp.onreadystatechange=stateChanged } else if (menu == 'occasion') { xmlHttp.onreadystatechange=stateChangedBrand } else { xmlHttp.onreadystatechange=stateChangedSize } xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { data = xmlHttp.responseText.split('|') document.getElementById("occasion").innerHTML=data[0] document.getElementById("brand").innerHTML=data[1]; document.getElementById("size").innerHTML=data[2]; } } function stateChangedBrand() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { data = xmlHttp.responseText.split('|') document.getElementById("brand").innerHTML=data[0] document.getElementById("size").innerHTML=data[1] } } function stateChangedSize() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("size").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.