hey guys, i got a little problem, i just started with javascript so there might be an easy solution but okay… im trying to make a function with which i can perform some simple actions: here my javascript:
IE: Line: 38, Character: 5, Error: Type mismatch
it has something to do with the objectid im trying to get from the other function…
[CODE]
var http = createRequestObject();
var objID = ”;
function createRequestObject(htmlObjectId){
var obj;
var browser = navigator.appName;
objID = htmlObjectId;
if(browser == “Microsoft Internet Explorer”){
obj = new ActiveXObject(“Microsoft.XMLHTTP”);
}
else{
obj = new XMLHttpRequest();
}
return obj;
}
function sendReq(serverFileName, objID, variableNames, variableValues) {
var paramString = ”;
variableNames = variableNames.split(‘,’);
variableValues = variableValues.split(‘,’);
for(i=0; i<variableNames.length; i++) {
paramString += variableNames[i]+’=’+variableValues[i]+’&’;
}
paramString = paramString.substring(0, (paramString.length-1));
if (paramString.length == 0) {
http.open(‘get’, serverFileName);
}
else {
http.open(‘get’, serverFileName+’?’+paramString);
}
http.onreadystatechange = handleResponse(objID);
http.send(null); <<< Line 38
}
function handleResponse(objID) {
if(http.readyState == 4){
responseText = http.responseText;
document.getElementById(objID).innerHTML = responseText;
}
}
I hope some of you guys can help me !
Thx!