@kokolegorille
I’m wondering what the best practice is for passing data from javascript to the template. In my project I’m using the browser API to user location data which I need to pass back to the server. At this point the user does not have a session and is anonymous. I want to pass the location data to a registration page which uses a get request to show a new action.
I had considered using a hidden form field (setting the hidden value with Javascript) but this did not seem right on a get request and to be honest I’m not sure if this would actually work.
I also considered setting a cookie and then retrieving it in the registration controller but again this does not seem right and would not work if cookies are disabled by the user.
I’ve searched through the documentation and have not come across anything that addresses this use case.
It appears that Live View has Hooks which allows this inter-operability but changing my page to Live View would not really be appropriate.
Any help would be appreciated.


















