I don't think it possible to pass javascript variable to web2py like that, it would be a big security hole if you can...
Not sure how it applies, but when I want to pass vars to component I just call or redirect to URL with the appropriate vars that I want to pass to the component from the master view/controller (the one in which there is component embeded)...
Then, my component just have to pickup the vars with request.vars.var with LOAD()... This can be does also with web2py_component() in javascript as show above...
But maybe you have a different requirement that I don't understand because you don't explained you use case nor showed code...
Richard