ababba2 Posted January 16, 2016 Share Posted January 16, 2016 (edited) On the column: Subtile_lang1 of the database there is: /mytext.txt mytext.txt is a file located at /components/my_component/info Using javascript I need to call the table for get the file name of that file.So far I tried to do this: $TXT_file = JURI::base() . $current_path . $this->htmlVideoDetails->subtile_lang1; This should grab the current path: /components/my_component/info and then it should add to this path the /mytext.txt that is stored in the database.This is my Javascript script: <script>videojs('ID', { plugins: { ass: { src: '<?= $TXT_file; ?>', button: 'true' } } })</script> But for some reason using <?= $TXT_file; ?> I can't get anything. How should I do for get what I need? Edited January 16, 2016 by ababba2 Quote Link to comment https://forums.phpfreaks.com/topic/300453-how-can-i-get-data-from-database-using-javascript/ 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.