var my_var = "<?php echo $my_variable; ?>";
var my_var = <?php echo $my_variable; ?>;
But, you can use on php file, Not on js file.
- Laravel ajax render view with data example
- How to insert multiple records in Laravel 5?
- Codeigniter JQuery Ajax image upload example from scratch
- Jquery select2 ajax autocomplete example with demo in PHP
- Laravel 5 - where condition with two columns example code
- How to get Ip Address in Laravel 5?
- Simple Highcharts Chart Example using PHP MySQL Database
- Bootstrap form validation example with demo using validator.js plugin