right now I'm sending json from laravel to View and filling out the form, the problem is that I need to make some changes based on this data from javascript. Right now I am using an Ajax request to request accurate data from the server, I think it is a bit repetitive, and I know that I can do something like (var data = {{$ data}}) and use it in the js file.
My question is: what is the best solution? Make an ajax call or make the variable directly from the view, I don't know if the variable from the view makes bad practice or not.
thanks
javascript ajax php laravel
Luiskx
source share