It works almost, but not 100% :) with encodeURIComponent :
abc def (test) comes back as abc_def__test_ a;slkdjf;l -239i4-29i23la'skfj(()))9012? <>,. = comes back as a_slkdjf_l_-239i4-29i23la_skfj_____9012______.__= This wouldn't help me, because I want it to be exactly whatever they enter - In contrast, atob and btoa work just perfect, except that in one particular situation is gets messed up by that exception... On Friday, May 17, 2019 at 10:17:50 AM UTC-4, Anthony wrote: > > 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 web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1e9addff-674e-471b-a570-c07d05df96af%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.