Skip to content

Instantly share code, notes, and snippets.

@valdezm
Created November 21, 2012 00:43
Show Gist options
  • Save valdezm/4122318 to your computer and use it in GitHub Desktop.
Save valdezm/4122318 to your computer and use it in GitHub Desktop.
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