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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -