Javascript don't do in Safari

Matsaki

Registered
Why can't Safari just use the normal Browser standards for Javasripts?

An example I have is a Play Sound function which is used for a rollover image:

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}


When running this JS Safari is opening the Player (QT) which I don't want, and if I comment out the last line (//else window.location = sndFile;)
The sound will play in Explorer or Mozilla without opening any player but in Safari it will do nothing :mad:

Did anyone have the same problems and found a fix?
 
Not sure on a fix, but why put a sound in the first place?

Site design should focus on the content of the site instead of "cool" features. Yea, thet're nice sometimes...but they do nothing to get the point across.
 
Safari doesn't handle files that require plugins. It delegates them to their respective applications. You can't open WM, RM, QT, or even sound files from within Safari, you have to download them and open them in a separate application, and it does this for you. I would like to see this change, but that's how it is right now. It may be "cool," but you need to either make the JS script ignore the sound effects if the browser is Safari, use a different file format (some may work, but I don't know which), or use Flash.
 
Hi Arden,
Thanks for your input but Hmm! The <bgsound> (Background sound) works without opening any helper application??? It's mostly the <embed> that don't work this way!
 
Back
Top