87,990
社区成员
发帖
与我相关
我的任务
分享
var sign = new Object;
sign.signDiv = document.getElementById('signUp');
sign.signUpButton = document.getElementById('signUpButton');
// sign.signUpButton.onclick = sign.signUp;
sign.userName = document.getElementById('userName').value ;
// error:Cannot read property 'value' of null
sign.removeSignDiv = function(){
// remove the sign up div.
this.signDiv.parentNode.removeChild( this.signDiv );
}
sign.signUp = function()
{ // sign up to user.php
ajax.open( 'GET', 'user.php?name='+ userName , true);
ajax.onreadystatechange = function(){
if( ajax.status == 200 && ajax.readyState == 4 ){
this.removeSignDiv();
// setInterval("getMessage();" , 5000);
}
}
ajax.send();
}