I have a method which works fine in FF, however in IE, I get a null or not an object error. Here is the code, IE complain about parameter lp which I pass value from another method.
[CODE]# function doLoadDictionary(word,lp,U){
# var X = !window.XMLHttpRequest ? new ActiveXObject(‘Microsoft.XMLHTTP’) : new XMLHttpRequest();
# X.open(‘GET’, U, true );
# X.onreadystatechange=function(){
# if (X.readyState == 4){
# if (X.status == 200) {
# if(U!=null){
# xmlDoc=X.responseXML;
# var eng = xmlDoc.getElementsByTagName(“english”);
# for(var i=0;i<eng.length;i++){
# if(word== eng[i].childNodes[0].nodeValue.toUpperCase()){
# slang = word;
# var lang = xmlDoc.getElementsByTagName(lp.toLowerCase());
# tlang = lang[i].childNodes[0].nodeValue;
# break;
# }
# }
# slang == undefined?(document.dictionary.english.value =”):(document.dictionary.english.value =slang);
# tlang == undefined?(document.dictionary.target.value =”):(document.dictionary.target.value =tlang);
# }
# }
# }
# }
# X.send(”);
# }
IE complains this line:
var lang = xmlDoc.getElementsByTagName(lp.toLowerCase()); that lp is null or not an object error.
Any help would be great. Thank you.