Created
November 21, 2012 00:43
-
-
Save valdezm/4122318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myUser={ | |
username: "not_set", | |
password: "not_set", | |
u_ready: "-1", | |
p_ready: "-1", | |
setupU: function(callback){ | |
temp_user.get("1",function(obj){ | |
var username2 = obj.value.username; | |
this.username = username2; | |
//alert("this should be called before"+this.username); | |
this.u_ready = "1"; | |
callback(this.username); | |
}); | |
}, | |
setupP: function(){ | |
temp_pass.get("1",function(obj2){ | |
var password = obj2.value.password; | |
this.password = password; | |
}); | |
}, | |
getU: function(callback_A, nothing){ | |
this.username=nothing; | |
if(this.u_ready == "-1"){ | |
this.setupU(function(user){ | |
nothing = user; | |
this.username = nothing; | |
//alert("returning username:"+nothing); | |
alert("returning this:"+this.username); | |
callback_A(user); | |
}); | |
} | |
}, | |
getU2: function(){ | |
return this.username; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment