How to write JSON code from PHP in JavaScript file -


this employeeshift.js code , can't figure out how php code in javascript file

this code inside employeeshift.js var inorno null

$(document).ready(function(){  var inorno= "<?php echo json_encode($inorout ); ?>";  if(inorno=="0"){   $('.sales1').hide();  }else{ $('.sales1').show(); }   }); 

rename js file php ....or past js code php file below

        <?php          //some of main php file code .......... ?> <script type="text//javascript">         $(document).ready(function(){      var inorno= "<?php echo json_encode($inorout ); ?>";      if(inorno=="0"){       $('.sales1').hide();      }else{     $('.sales1').show();     }           });  </script> 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -