Forum Moderators: travelin cat
Any help is appreciated!
We need:
1) a reference to your website in your profile so we can access your script
2) a list of browsers you've tried on WinTel
Offhand I'ld say that the most commom reason a javascript doesn't work on Mac browsers is the totally ignorant use of document.all().
Site in question is in my profile.
I've tried it on IE 6, NS 7, and Opera. And I've tried it on a number of other machines using mostly different versions of IE. It only doesn't work for people with Macs and they claim to have tried current versions of IE and Safari. They have JS enabled and are able to run other JS.
If there was anywhere I'd expect to run into Sherlock Holmes, it'd be here! :)
Thanks for taking the time to reply.
On an image map I have areas like:
<area shape="rect" coords="0,75,770,113" onmouseover="playSound(5)" onmouseout="stopSound(5)">
Here is the code. One of those timesaving cut & paste jobs...
// Sound on Mouseover javascript supplied by [snip]
var aySound = new Array();
// PLACE YOUR SOUND FILES BELOW
aySound[0] = "B.mid";
aySound[1] = "E.mid";
aySound[2] = "A.mid";
aySound[3] = "D.mid";
aySound[4] = "G.mid";
aySound[5] = "C.mid";
// Don't alter anything below this line
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE¦¦NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.soundfiles:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//--></script>
Thanks.
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
IE on mac doesn't have document.all .
LiveAudio isn't an available plugin. As far as I've been able to discern LiveAudio is a Netscape 3 & 4 technology that has been discontinued. Sound on Mac is handled by "QuickTime Plug-in 6.5.1" or "Windows Media Plugin".
Your script doesn't detect Safari or OmniWeb or Opera.
Thus your script simply exits.
if (NS) auEmb = new Layer(0,window);
Conclusion:
Your script is written to work only in IE under WinTel or NS4 (any platform).
It won't work with anything else.
Advise (and only cure):
Rewrite the script to use the w3c DOM
ANY use of 'document.all' is bound to give you serious trouble if you want your script to work in anything else than IE for WinTel.