Javascript-Obj communication implementation