i have a screen file let say screenA.blade.php
. inside this file, i want call a constant file that store some of string let say constant.js
.
is this possible?
this is what i have inside screenA.blade.php
<head>
<script>
...
// some of js code here
// want call string from constant.js here
// console.log(string from constant.js)
...
<script>
<head>
2
Answers
Once you’ve inserted the script tag for
constant.js
, then you’re able to use the variable defined in theconstant.js
file.An example for
screenA.blade.php
might look like the below code snippet:Yes you can, put the file constant.js inside in file screenA.blade.php