I got a function in javascript that first checks if the username is the required length and than sends the username to a page for a test if the test is a success there will be a
<span id="username">true</span>
else
<span id="username">false</span>
I keep getting an error that getElementById doesn't exist on the return data
function checkuser(user, wd,id, sub)
{
if(user.length < 7)
{
document.getElementById(id).innerHTML = "Your username is too short. It must be longer than 6 charaters";
document.getElementById(sub).disabled = true;
return false;
} else {
$.post(wd + "register/checkuser/" + user,
function(data){
alert("Data Loaded: " + data.getElementById('username').innerHTML;
});
}
}