Working with PHP data inside javascript.
Echo or passing a php number in javascript may turn it to be string instead of integer.
example:
<input type="text" onchange="math( '<?php echo '1';?>' )"> <script type="text/javascript"> function math( number ){ //here the number will be string //to be able to process the string as number, use parseInt var no = parseInt(number); } </script>
What do you think?