laravel how to route to a route on a javascript?
问题 I have this jquery $(".waitingTime .button").click(function () { alert("Ema"); }); I have a a tag like this: <a href="{{ URL::to('restaurants/20') }}"></a> Can I do the same href action in the jquery function? Many Thanks 回答1: yes this is possible and has nothing to do with Laravel. There are different possibilities. If your query is embedded within the same laravel view, you put the URL directly in your jQuery code, for example like this: $(".waitingTime .button").click(function () { window