193
rated 0 times
[
200]
[
7]
/ answers: 1 / hits: 27813
/ 9 Years ago, sat, june 6, 2015, 12:00:00
Initially, I wrote all the JavaScript code right in my HTML page using the <script>
tag.
A post call in jQuery in the JavaScript was something like this.
$.post('store',{'_token':'{{csrf_token()}}'}, function(data){ /*a bunch of code*/ });
The code worked fine. But, later I put all my script into an external js file. And the code is not working anymore.
I have the problem with the {{csrf_token()}}
, the error being
TokenMismatchException in compiled.php
What should I do if I want to external js files with Laravel?
More From » php