Passing Two Variables In Route Through Javascript Function In Laravel
I am trying to send two variables in route through java script function. Javascript function: function bookmark() { var url = '{{ route('save_bookmark',':b_id',':p_no')
Solution 1:
you can still do it this way!
javascript
functionbookmark()
{
var url = '{{ route("save_bookmark",":b_id",":p_no") }}';
url1 = url.replace(':b_id', book);
url2 = url.replace(':p_no', count);
//document.location.href = url;document.href="https://example.com/save_bookmark/"+url1 +"/"+url2;
or
location.href="https://example.com/save_bookmark/"+url1 +"/"+url2;
}
Post a Comment for "Passing Two Variables In Route Through Javascript Function In Laravel"