In my javascript, I need to use a route. In the Symfony's documentation, it said that I can include my script in the twig to get the route BUT my route needs a parameter, then I found
var isbn = 1234567890;
var url = {{ path('book_search_general', {'isbn': 'isbn'}) }};
url.replace("isbn", isbn);
But javascript believes that it is a regular expression. In the HTML source code it's:
var url = /public/book/isbn;
url.replace("isbn", isbn);
An I have the error:
Uncaught SyntaxError: Invalid regular expression flags