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 1801 -
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 the PARAMETRES file.
Now, I would like to be able to get the same thing in python. I
googled and played with os.system to try to come up with something but
no success so far. I also tryed exec but it doesn't work becaus a lot
of string...
|
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 variable as the value in this line
<input type="hidden" name="AMT" value="**">
|
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 you in advance.
|
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 tell me why these DIVs don't drift to the left as they are
supposed to?
<script language="javascript">
|
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 stuff in ASP and PHP
so I'm familiar with server-side programming; for some reason JavaScript
syntax trips me up.
I want to assign a value to a variable according to an onclick event,
and then run an if...then on the variable, and according to...
| |
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 what I'd like to have happen :
|
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 submitted the onClick passes the table row to the javascript function, i then concatinate a string to be the same as the id of the element i want the input from.
i use the script below to get the input but the error i get is...
|
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 follows:
The code below is for the first page:session_start is in line 3
<link href="css/jobSheet.css" rel="stylesheet" type="text/css" />
session_start();
|
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, if I click on the Update button, the values in the
text-area must be updated in the mysql database.
I am storing the values of the text-area in a variable. I am using
javascript to pass the variable.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |