hi,
Deprecated method document.getSelection() called. Please use window.getSelection() instead.
The following is the code that generates the error:
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.');
}
});
});
//the html:
<form method="post" id="form2">
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="userId">User ID</label></td>
<td><input type="text" name="userId" id="userId" size="32" />
<a id="chk1" href="javascript:chkAva('chk1','userId')">check</a> </td>
</tr>
<tr>....