i have this code :
$('button#monbtn').click(function() {
var username = $('#username').val();
var msg = $('#msg').val();
var url = "{{ path('ajax_subcategories', {'username': username,'msg':msg})|escape('js') }}";
}
I get the username and msg from inputs, and i want to add them to the url, but i get an error saying that variable username doesn't exist.