javascript - Outputting a var with a colon in it -
javascript - Outputting a var with a colon in it -
i config in js:
<script>var r = {{ config::get('app::r') }}; console.log(r);</script>
the {{}} laravel, echos stuff php.
the problem error:
uncaught syntaxerror: unexpected token :
the r in config has : in it. is:
r => '1:1';
how can deal outputting string?
<script>var r = "{{ config::get('app::r') }}"; console.log(r);</script>
javascript
Comments
Post a Comment