Reputation: 7040
How can I pass a variable value from a template using JavaScript without using a form (GET OR POST)?
Upvotes: 1
Views: 619
Reputation: 598
You can send this value from JavaScript via Xml Http Request without using form - see how AJAX works. See for example POST request with jQuery JS library.
The uri
parameter is URI of your Django view, data
- JS object that you send to server and finally callback
- JS function to process server response.
Upvotes: 2