Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 25th, 2007, 07:55 AM
dkl1
Guest
 
Posts: n/a
Default 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.


  #2  
Old January 26th, 2007, 03:05 PM
Smarty
Guest
 
Posts: n/a
Default 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, 11:05 AM
dkl1
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.