Hello everybody, I've written a program which contains AJAX...
The program is a messenger...
The code was:
var http = createRequestObject();
function createRequestObject(){
var request_;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_ = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
request_ = new XMLHttpRequest();
}
return request_;
}
function getInfo(){
http.open('get', 'Rooms_Func.php?id=23');
http.onreadystatechange = handleInfo;
http.send(null);
}
function handleInfo(){
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('ChtPlc').innerHTML = document.getElementById('ChtPlc').innerHTML+response;
}
}
The problem was:
when the user selects a text ... the text becomes unselected automaticially !!
I think the mistake was in:
document.getElementById('ChtPlc').innerHTML = document.getElementById('ChtPlc').innerHTML+response;
What do you think??
Please help me quickly :(