Jump to content
Sign in to follow this  

How can I get data from database using Javascript?

Recommended Posts

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'

But for some reason using <?= $TXT_file; ?> I can't get anything. How should I do for get what I need?

Edited by ababba2

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.