If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Feb 2019
    Member #

    Need help with Ajax request

    hello, i am trying to popular a javascript variable with php data fetch from the database using a ajax request. is there a way to do this without having a button to request the data needed to popular the list?

    this is a audio player

    function audioApp(){
    var audio = new Audio();
    var audio_folder = "audio/";
    var audio_ext = ".mp3";
    var audio_index = 1;
    var is_playing = false;
    var playbtnarray;
    var playingtrack;
    var trackbox = _("trackbox");
    /*var tracks = {
    "track1": ["Cheyenne", "cheyenne"],
    "track2": ["Get Ugly", "get_ugly"],
    "track3": ["Pull-Up", "pull-up"],


    var hr = new XMLHttpRequest();
    var url = "tracks.php", true);
    hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    var tracks = {
    var url = "tracks.php";

    the green script is how the script is working at the moment but as you see, i have to manually add the songs to the list, i would like to add the list dynamically using ajax like how i try to do with the script in the red but i know im missing something to make this work properly or correctly. i honestly do not know what the hell im doing here hahaha

    any help would be greatly appreciated


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 06:40 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: