Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old January 25th, 2007, 08:55 AM
dkl1
Guest
 
Posts: n/a
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.

  #2  
Old January 26th, 2007, 04:05 PM
Smarty
Guest
 
Posts: n/a

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


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:
Quote:
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.
  #3  
Old January 28th, 2007, 12:05 PM
dkl1
Guest
 
Posts: n/a

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


Thanks!

Smarty כתב:
Quote:
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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
JS error, "x has no properties" - accordion-style dropdown menu luispunchy answers 1 October 6th, 2007 03:40 PM
NEED HELP!! Firefox not recognizing the "name" property?!?!?! ajschuster@gmail.com answers 4 April 10th, 2006 09:45 PM
Can't make this page work scottyman@comcast.net answers 6 March 9th, 2006 04:25 AM
.NET version of "ActiveX" ? Andrew answers 5 November 18th, 2005 12:45 PM