gweilo Posted June 10, 2020 Share Posted June 10, 2020 How can i put an variable for example $variable = 'something'; and then how do i put this into this js script <script>$(document).ready(function() {$('#open$variable').dataTable();});</script> note: Im trying to put this '$variable' inside ' ' right after #open. Quote Link to comment https://forums.phpfreaks.com/topic/310921-insertin-php-variable-into-js-function-script/ Share on other sites More sharing options...
Barand Posted June 10, 2020 Share Posted June 10, 2020 Put the variable value into a hidden field in the html. In the JS, get the value from the hidden field. Quote Link to comment https://forums.phpfreaks.com/topic/310921-insertin-php-variable-into-js-function-script/#findComment-1578817 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.