Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:12:55+00:00 2026-06-07T04:12:55+00:00

Okay so I have an html5 audio player that i built with jquery however

  • 0

Okay so I have an html5 audio player that i built with jquery however i need to get the track url from the variable in the url with a get request so that it can then be used in the jquery script. Not sure how to do it. I have the jquery in a seperate file to the markup for easy embedding for users. The url will look like http://www.mysite.co.uk/player/player.html?url=testing123.mp3.

I can easily get the variable for use in the markup to show the name of the artist etc with PHP but not sure how to do it for the jquery script. I have had a look around but no luck.

Heres the relevent jquery

song = new Audio('THIS IS WHERE THE GET VARIABLE NEEDS TO BE');

I shouldnt think anymore code is needed but if it is just ask.

head

<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>

<?php $url = $_GET['url']; ?> 

<script> // Before jQuery
    var song = new Audio(`<?php echo($url); ?>`);
</script>`
<script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/js.js"></script>
<script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/html5slider.js"></script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:12:56+00:00Added an answer on June 7, 2026 at 4:12 am
    <?php
    $url = $_GET['url']; // Avoid this way! Need to be as safe as possible.
    ?>
    
    [...]
    
    <head>
        [...]
    
        <script> // Before jQuery
            var song = new Audio(`<?php echo($url); ?>`);
        </script>`
    
        [...]
    </head>
    

    And remove song from your .js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number that I need to pull from my html: <span>123,456.78</span> How
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay, so I have an javascript function that retrieves some HTML... function updateQuestions(i){ var
Okay I'm using XHTML1.1 due to the fact that HTML5...doesn't behave as I expect,
Okay so I have this page with quite a lot of javascript/jQuery in it.
Okay, I want to control the volume of an HTML5 element using the jQuery
Okay so I have a box that I made in CSS and what I
I have a link on my page that when clicked uses .$get and then
Okay, I have hundreds of .net controls with text attributes that needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.