I have the following code
function exec(param1,p2,fun){
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function(fun){
data=xmlhttp.responseText;
fun(data);
}
// rest ajax connection code
}
when i call
exec(param1,param2,
function(data){
alert (data);
});
it says
Object not a function
in the definition at line fun('test');
any ideas ?