Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file name problem 1

Status
Not open for further replies.

Serendipiter

Programmer
Jun 22, 2010
18
US
Will this file name be interpreted properly by javascript?
'
It works when I enter it in an Internet Explorer URL box.

I'm using it as follows, but it doesn't play the sound file:
old.innerHTML="<embed src=' hidden=true autostart=true loop=false>";

The javascript code above does work with the same sound file in a different location. The following works:
old.innerHTML="<embed src='file:///C:\Users\Brian\Desktop\scream.wav' hidden=true autostart=true loop=false>";

Do I need to specify the file name differently to make it work with javascript?
 
Embed expects an actual file to embed, yet you are passing it a URL that merely serves the file for download.

In reality the file you are embedding is not scream.wav but jdownload.cgi. This file is a script that takes 2 parameters, one of which happens to be a file name

The Embed works fine as the download does occur.

To get this to work, you would need to host the file somewhere else and access its url directly rather than through the cgi script.

With that said, this has nothing to do with Javascript, its simply the way the embed html tag works.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Thank you for your help. I think I may be restricted to accessing the file using the script (I cannot directly access the file on the server or upload one to the server). Do you have a suggestion for accessing it using javascript?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top