Jump to content

[SOLVED] How to wrap this up in a function and replace the element?


ollie007

Recommended Posts

    <script type="text/javascript">  
    AudioPlayer.embed("audioplayer_1", {  
        soundFile: "http://yoursite.com/path/to/mp3_file_1.mp3"
    });  
    </script>  

 

echo "Need more details, and some context, before anyone can help you out.";
echo "What element needs to be replaced?  How/where are you calling the embed function?";
echo "Also, you DO realize it's rude to simply write a block of code and say 'fix it,' right?";

Link to comment
Share on other sites

 <p id="audioplayer_1">Alternative content</p>  

         <script type="text/javascript">  
         AudioPlayer.embed("audioplayer_1", {soundFile: "http://yoursite.com/path/to/mp3_file.mp3"});  
         </script> 

 

i would like to replace that element, unfortunately, the CMS i am using is parsing out, "onclick, JS" etc

 

so i need to wrap up the js in a simple funtion like

 

$('audioplayer_1').loadaudio($link, $title)

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.