You can first use a placeholder to generate the URL with and then replace that in javascript.
var url="{{ route("admin.stocks.edit", ":id") }}";
url = url.replace(':id', stock.id);
$('.stocks_list').append('<li><a href="'+url+'">' + stock.symbol + ' </a></li>');
More Related Contents:
- jQuery append function is just appending the html but not the classes related to it
- Passing a PHP variable to JavaScript in a Blade template
- Displaying pdf from arraybuffer
- Removing # from url in Angularjs while having .run in routes
- How to use Select2 with JSON via Ajax request?
- how to fix ‘Access to XMLHttpRequest has been blocked by CORS policy’ Redirect is not allowed for a preflight request only one route
- Vue js error: Component template should contain exactly one root element
- How can I return a view from an AJAX call in Laravel 5?
- Using JavaScript to display Laravel’s Variable [duplicate]
- Vue JS returns [__ob__: Observer] data instead of my array of objects
- How to check the value of input [closed]
- What is component in reactjs?
- How to rewrite this code using recursion? [closed]
- What’s the best way to validate an email address in JavaScript?
- How can I add a key/value pair to a JavaScript object?
- How to invoke a JSF managed bean on a HTML DOM event using native JavaScript?
- Detecting when user scrolls to bottom of div with jQuery
- Comparing Arrays of Objects in JavaScript
- Can Javascript read the source of any web page?
- Node.js can’t create Blobs?
- How to trigger click on page load?
- Can we refer to JavaScript variables across webpages in a browser session?
- Is JavaScript object-oriented?
- jQuery: difference between .click() AND .on(“click”)
- Why most of the time should I use const instead of let in JavaScript?
- Pass unknown number of arguments into JavaScript function
- Prevent IE11 caching GET call in Angular 2
- How do I access properties of a javascript object if I don’t know the names?
- Sorting Array with JavaScript reduce function
- Dynamically generated table – using an array to fill in TD values