473,466 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

JavaScript change "element" of and OBJECT (html tag)

Hi,

I have the following HTML code (for playing a WAV sound file):
<OBJECT ID=vidCtrl_success
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A"
STYLE="display:none" VIEWASTEXT>
<PARAM NAME="FileName" VALUE="MySong1.wav">
</OBJECT>

I have in the same dir several files, which I named:
MySong1.wav, MySong2.wav, MySong3.wav, ...etc.

=I want to load a random file each time the page is visited (by
dynamically changing th above OBJECT).

How can I accomplish this?

TIA.

Jan 25 '07 #1
2 2346
Hi,

Hope you going to work with dir structure using any of the Server
scripts (PHP,ASP, JSP, etc.,). So each time u take the random file path
using any of the Server scripts and write the name in the VALUE
attribute.

PHP EX:

<OBJECT ID=vidCtrl_success
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A"
STYLE="display:none" VIEWASTEXT>
<PARAM NAME="FileName" VALUE="<?=$fname?>">
</OBJECT>

If you not using any Server Scripts, then you want to be sure about the
file name's consistency. The file's name should end with a unique
number. Then you want to generate a random number and concade the value
in the VALUE attribute. This is a UGLY method, bec if the random number
generated as MySong76.wav and if that file was not there then, no song
will be played.

Regards,

M. Sriram

On Jan 25, 1:48 pm, "dkl1" <liordek...@gmail.comwrote:
Hi,

I have the following HTML code (for playing a WAV sound file):
<OBJECT ID=vidCtrl_success
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A"
STYLE="display:none" VIEWASTEXT>
<PARAM NAME="FileName" VALUE="MySong1.wav">
</OBJECT>

I have in the same dir several files, which I named:
MySong1.wav, MySong2.wav, MySong3.wav, ...etc.

=I want to load a random file each time the page is visited (by
dynamically changing th above OBJECT).

How can I accomplish this?

TIA.
Jan 26 '07 #2
Thanks!

Smarty כתב:
Hi,

Hope you going to work with dir structure using any of the Server
scripts (PHP,ASP, JSP, etc.,). So each time u take the random file path
using any of the Server scripts and write the name in the VALUE
attribute.

PHP EX:

<OBJECT ID=vidCtrl_success
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A"
STYLE="display:none" VIEWASTEXT>
<PARAM NAME="FileName" VALUE="<?=$fname?>">
</OBJECT>

If you not using any Server Scripts, then you want to be sure about the
file name's consistency. The file's name should end with a unique
number. Then you want to generate a random number and concade the value
in the VALUE attribute. This is a UGLY method, bec if the random number
generated as MySong76.wav and if that file was not there then, no song
will be played.

Regards,

M. Sriram
Jan 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: RodneyDunes | last post by:
My site did validate and now it doesn't. The error I get is the following: document type does not allow element "META" here ....nt-type" content="text/html;charset=iso-8859-1"> Can someone...
15
by: Barry | last post by:
Hi group, Does anyone know why I get a W3 validator error (click the validation link at the bottom of the page) for http://www.polisource.com/consumer-protection.shtml saying "Line 227, column...
0
by: maersa | last post by:
Hi all, i'm serializing an arraylist like the following with an "Role" object as it's item. ----------------------------------------------------- ---- ArrayList ar = new ArrayList();...
7
by: Quentin Huo | last post by:
Hi: I created a web-form user control. And in client-site, there is a link which will create a Input element object when it is clicked. <script language=javascript> ....... var nameInput =...
5
by: garfy | last post by:
Hi i get this error in validation Line 22 column 6: document type does not allow element "title" here. <title>Seo Web Design Los Angeles - Web Design And Search Engine Optimization L ...
7
by: Zhang Weiwu | last post by:
Dear all How does javascript realiablily tell if a variable is a reference to an HTML Element "<select>", without causing browser to pop up error message? if (variable.constructor ==...
1
by: bluehtrombone | last post by:
Hi everybody, I am trying to extend the JavaScript's native class Element as below. If I then create two or more distinct objects, assigning values to any of them affects all the objets as if they...
3
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
4
by: jaime.dyson | last post by:
Hello all, I have the unenviable task of turning about 20K strangely formatted XML documents from different sources into something resembling a clean, standard, uniform format. I like...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.