On Thursday, May 16, 2019 at 3:43:58 PM UTC-4, Vlad wrote:
>
> I have the following javascript in the view:
>
> var id = $('#CurrentCartId').text();
> var description = $(this).text();
> var url='{{=URL('cart','description')}}';
> url += '/' + id + '/';
> url += description;
> ajax(url,[],':eval');
>
How about putting the variables in the query string:
const id = $('#CurrentCartId').text();
const description = $(this).text();
const url='{{=URL('cart','description')}}';
ajax(
`${url}?id=${encodeURIComponent(id)}&description=${encodeURIComponent(description)}`
, [], ':eval');
Then in the controller, access request.vars.id and request.vars.description.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/e574b961-7bc2-4dba-86d4-1f231da4d008%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.