Ref means you want to maintain the change. What you are trying is not possible as far I know. You are trying to call a server method from JavaScript - that would a stateless call. You cannot maintain an object this way. I am not sure why are you trying to do such stuff but there can be other ways like using XMLHttpRequest to send the data and get back what you want on client side.
I would suggest using XMLHTTPRequest here for calling a server method and getting back data:
XMLHttpRequest[
^]