I have the next route in Symfony:
path: /BuscarCriterio/{nombre}
How Can i pass the Variable {nombre} with JavaScript?
var nombre=$('#form_nombre').val();
var Ruta= "{{ path('BuscarporCriterio',{'nombre':I need my JS Variable Here }) }}";
it is necessary to know i can't use window.location because i need this route for make a call to Ajax.
Thanks for your answer!