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
Post a Comment