Hi,
I have this piece of code and I need to get the value of the variable 'filmus1" into the audioplayer line. - <p id="audioplayer_m">blabla</p>
-
<script type="text/javascript" language="JavaScript">
-
function choosebox1()
-
{
-
var filmus="";
-
var filmus1= "";;
-
varNumber = <?php echo '"'.$i.'"'; ?>;
-
for (k=0; k<varNumber; k++) {
-
if(document.getElementById('CBT'+k).checked){
-
if (filmus==""){
-
filmus = filmus + (document.getElementById('CBT'+k).value);}else
-
{filmus = filmus + "," + (document.getElementById('CBT'+k).value);}
-
}else {}
-
}
-
filmus1 = '"' + filmus + '"';
-
AudioPlayer.embed("audioplayer_m", {soundFile: (get the filmus1 value here), width: 400, autostart: "yes"});
-
}
-
</script>
Thanks for any help.
5 1794 -
AudioPlayer.embed("audioplayer_m", eval('({soundFile: "'+filmus1+'", width: 400, autostart: "yes"})'));
-
I used eval to evaluate JSON object.
acoder 16,027
Recognized Expert Moderator MVP
Why not use it directly (haven't tested, mind you)? - AudioPlayer.embed("audioplayer_m", {soundFile: filmus1, width: 400, autostart: "yes"});
Does that not work?
- <p id="audioplayer_m">Play</p>
-
<script type="text/javascript" language="JavaScript">
-
function choosebox1()
-
{
-
var filmus="";
-
varNumber = <?php echo '"'.$i.'"'; ?>;
-
for (k=0; k<varNumber; k++) {
-
if(document.getElementById('CBT'+k).checked){
-
if (filmus==""){
-
filmus = filmus + (document.getElementById('CBT'+k).value);}else
-
{filmus = filmus + "," + (document.getElementById('CBT'+k).value);}
-
}else {}
-
}
-
AudioPlayer.embed("audioplayer_m", {soundFile: eval("filmus"), width: 400, autostart: "yes"});
-
}
-
-
</script>
acoder 16,027
Recognized Expert Moderator MVP
Does it not work without the eval?
PS. please use [code] tags.
Nope, only with eval.
Thanks,
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: biner |
last post by:
Hello,
I have file called PARAMETRES that is used in bourne shell script to
define variable. In order to do so I put a ". PARAMETRES" line and the
script has acces to all the variable defined in...
|
by: otto |
last post by:
i need to read a variable in a javascript and translate it to a form in
html
the javascript variable is:
<SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script>
and i need to put that...
|
by: Chuck |
last post by:
Hi!
Any ideas as to how I can get ride of the script error undefined
variable "Exp_Month"?
I am trying to get this drop down list to default to the current month
as opposed to 01.
Thank...
|
by: lawrence |
last post by:
Sorry for the dumb question but I'm new to Javascript. I wrote this
script hoping to animate some div blocks on a page. You can see the
page here: http://www.keymedia.biz/demo.htm
Can anyone...
|
by: Byron |
last post by:
Hi,
Javascript confuses me, so I usually limit myself to Dreamweaver's
built-in scripts for stuff like imageswaps. But this time I'm trying to
write something very simple myself. I do most of my...
| |
by: gimme_this_gimme_that |
last post by:
Hi,
This is sort of a :
How to build a Yes/No dialog box qquestion.
Or perhaps a question about getting javascript variables
from a pop-up window and processing them on a submit.
This is...
|
by: robing |
last post by:
I am having trouble getting data from a text input field element.
the element is called amount_$counter with $counter being the row of the table.
when i have made an input to the text field and...
|
by: simbarashe |
last post by:
Hie
could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
|
by: satish2112 |
last post by:
Hi,
I have a text-area which contains values from mysql database and 2
buttons, Edit and Update.
When I click on the Edit button, I can edit the text-area
(initially non-editable).
After this,...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |