Jump to content

How can I get data from database using Javascript?


ababba2

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'
    }
  }
})</script>

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

Edited by ababba2
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.

×
×
  • 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.