After clicking a button on the client side, I am storing the window.location.href
property in a JavaScript variable. Now, I need to send this variable back to the server. How can I retrieve the value of the JavaScript variable in Mason code?
Currently, I have implemented one option where I dynamically create a hidden text field with the value set to window.location.href
, and then initiate a form submit.
My question is, how can I use ajax instead of form.submit()
? I'm seeking an ajax solution and would like to understand the difference between using ajax and form.submit()
.