[jQuery] document.getSelection() and FireFox 2.0.0.11
Hi,
The following code doesn't work with FireFox. It works fine with MSIE
7. This message was generated from error consol:
Deprecated method document.getSelection() called. Please use
window.getSelection() instead.
The code :
function chkAva(lnk,id){
el = document.getElementById(id).value;
if (el == ''){
alert('The user id should have a value before check');
return;
}
av = "Available";
na = "Not Available, choose another one!"
$(document).ready(function(){
$("#"+lnk).before("<img src='imgs/wait.gif' id='waitImg' /> ");
$.ajax({url: 'chk_user.php',type:'GET', data: 'Id='+ el, cache: false,
dataType: "script", success: function(data, textStatus){
$("#waitImg").remove()
if (data == 0){
if (document.getElementById('av') == null){
$("#"+lnk).after(" <span id='av' class='hint'> "+av+"</span>");
}
else{
$("#av").empty();
$("#"+lnk).after(" <span id='av' class='hint'> "+av+"</span>");
}
}
else{
if (document.getElementById('av') != null){
$("#av").empty();
}
$("#"+lnk).after(" <span id='av' class='hint'> "+na+"</span>");
}
},
error: function(x,txt,err){
$("#waitImg").remove();
alert('Could not check...'+"\n"+'The server may down or busy. Retry
again after a while.');
}
});
});