seanybravo
IS-IT--Management
Could someone please help me find the syntax error in this cod I have been looking tat it for the last 4 hours and am unable to work it out:
var xmlHttp
function stateChanged2(obj,id){
document.getElementById(id).innerHTML=obj.responseText
}
function GetXmlHttpObject(URL, handler, id, strSend) {
alert("HELLO")
var objXmlHttp=null
try {objXmlHttp = new XMLHttpRequest();
}
catch(e){
try{objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){alert("error opening XMLHTTP")
}
}
}
objXmlHttp.onreadystatechange=function(){
if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){
handler(objXmlHttp, id)
}
}
xmlHttp.open("POST",URL,true)
xmlHttp.setRequestHeader("Content-Type", "application/x- xmlHttp.send(strSend)
}
The HLML BIT
<input name="radiobuttonCustomData" type="radio" onclick="GetXmlHttpObject("Ajax.asp", stateChanged2, "CustomRecords", "Load=true")" value="true" />
var xmlHttp
function stateChanged2(obj,id){
document.getElementById(id).innerHTML=obj.responseText
}
function GetXmlHttpObject(URL, handler, id, strSend) {
alert("HELLO")
var objXmlHttp=null
try {objXmlHttp = new XMLHttpRequest();
}
catch(e){
try{objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){alert("error opening XMLHTTP")
}
}
}
objXmlHttp.onreadystatechange=function(){
if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){
handler(objXmlHttp, id)
}
}
xmlHttp.open("POST",URL,true)
xmlHttp.setRequestHeader("Content-Type", "application/x- xmlHttp.send(strSend)
}
The HLML BIT
<input name="radiobuttonCustomData" type="radio" onclick="GetXmlHttpObject("Ajax.asp", stateChanged2, "CustomRecords", "Load=true")" value="true" />