I am using Laravel and i'm making an AJAX request. In the success event I wrote:
var name = response.filename;
var path = "<?php echo route('getImage', "name")?>";
document.getElementsByClassName("getImage")[0].setAttribute("src", path);
But it looks like on the second row the name variable is interpretated as text, not as variable. And the src's value is
How could I get this right?
routefunction on the server side, return its result in the success response and set it as the imagesrc.successcallback in JS