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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Site Check: Java Problems with Safari

Status
Not open for further replies.

whiskey3

Technical User
Mar 29, 2002
8
Link here:


In IE the javascript is fine but my client says in Safari they can't see the java anim. Are they missing a Saafari Java plugin or is it a security problem in Safari. I don't use Safari so I'm completely clueless why they can see the nav bar in Safari but no the java animation in the page?

Thanks.

WOLF VIDEO
,WOLF VIDEO
 
You're mixing terminology like it's the in thing! Java is not JavaScript. The two are as different as Coke and Pepsi.

That aside, as far as I can see, you have no Java or JavaScript animation on your page anyway - although you do have a Flash animation.

Does the user have the Flash player (or plugin) installed in Safari? This would be the first thinig I would check.

If so, I'd take this to the Flash forum (why the Flash isn't showing up in Safari)... Of course, this assumes that it is the Flash the user cannot see (I'm only guessing - you seem to think it is Java, but there are no Java applets on the page).

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I'm sorry if I didn't explain well enough....

Link here:


The javascript in this page does not show in Safari only IE?
Does anybody know why it doesn't work in Safari?

Code Below:
-------------------------------------

<Script Language=javascript>
var slideshowSpeed1 = 3000;
var slideshowSpeed2 = 3000;
var slideshowSpeed3 = 3000;
var slideshowSpeed4 = 3000;
var crossFadeDuration1 = 3;
var crossFadeDuration2 = 3;
var crossFadeDuration3 = 3;
var crossFadeDuration4 = 3;

var currIMG1 = 0;
var currIMG2 = 0;
var currIMG3 = 0;
var currIMG4 = 0;

var Pic1 = new Array()
Pic1[0] = 'Pic1[1] = 'Pic1[2] = 'Pic1[3] = 'Pic1[4] = '

var nPix1 = Pic1.length-1;
var preLoad1 = new Array()
for (i=0; i<nPix1+1; i++)
{
preLoad1 = new Image()
preLoad1.src = Pic1
}

var Pic2 = new Array()
Pic2[0] = 'Pic2[1] = 'Pic2[2] = 'Pic2[3] = '



var nPix2 = Pic2.length-1;
var preLoad2 = new Array()
for (n=0; n< nPix2+1; n++)
{
preLoad2[n] = new Image()
preLoad2[n].src = Pic2[n]
}

var Pic3 = new Array()
Pic3[0] = 'Pic3[1] = 'Pic3[2] = 'Pic3[3] = '

var nPix3 = Pic3.length-1;
var preLoad3 = new Array()
for (t=0; t<nPix3+1; t++)
{
preLoad3[t] = new Image()
preLoad3[t].src = Pic3[t]
}




function runslideshow1(){
slideshow1.style.filter="blendTrans(duration=2)";
slideshow1.style.filter="blendTrans(duration=crossFadeDuration1)";
slideshow1.filters.blendTrans.Apply();
slideshow1.src = preLoad1[currIMG1].src;
slideshow1.filters.blendTrans.Play();
currIMG1++
if (currIMG1 > (nPix1)){currIMG1=0}
setTimeout('runslideshow1()',slideshowSpeed1);
}

function runslideshow2(){
slideshow2.style.filter="blendTrans(duration=2)";
slideshow2.style.filter="blendTrans(duration=crossFadeDuration2)";
slideshow2.filters.blendTrans.Apply();
slideshow2.src = preLoad2[currIMG2].src;
slideshow2.filters.blendTrans.Play();
currIMG2++
if (currIMG2 > (nPix2)){currIMG2=0}
setTimeout('runslideshow2()',slideshowSpeed2);
}

function runslideshow3(){
slideshow3.style.filter="blendTrans(duration=2)";
slideshow3.style.filter="blendTrans(duration=crossFadeDuration3)";
slideshow3.filters.blendTrans.Apply();
slideshow3.src = preLoad3[currIMG3].src;
slideshow3.filters.blendTrans.Play();
currIMG3++
if (currIMG3 > (nPix3)){currIMG3=0}
setTimeout('runslideshow3()',slideshowSpeed3);
}



</Script>

</Head>
<Body>
<Table align="center">
<TR>
<TD align=center>
<a href="hearingprotection2.htm"><img src="slideshow1_1.jpg" name="slideshow1" width=200 height=150 border="0" id='slideshow1'></a><br></TD>
<TD align=center><a href="disposablerespirators.htm"><img src="slideshow2_1.jpg" name="slideshow2" width=200 height=150 border="0" id='slideshow2'></a></TD>
</TR>
<TR>
<TD align=center valign="top"><font size="3" face="Arial, Helvetica, sans-serif"><a href="hearingprotection2.htm"><strong>Hearing Protection</strong></a> </font></TD>
<TD align=center valign="top"><p><font size="3" face="Arial, Helvetica, sans-serif"><a href="disposablerespirators.htm"><strong>Disposable Respirators</strong></a> </font></p>
<p>&nbsp;</p></TD>
</TR>
<TR>
<TD align=center>
<a href="8000series.htm"><img src="slideshow3_1.jpg" name="slideshow3" width=200 height=150 border="0" id='slideshow3'></a><br></TD>
<TD align=center><a href="whatsnew.htm"><img src="images/slideshow/whatsnew.jpg" width="200" height="150" border="0"></a></TD>
</TR>
<TR>
<TD align=center><strong><font size="3" face="Arial, Helvetica, sans-serif"><a href="8000series.htm">8000 Series</a></font></strong></TD>
<TD align=center>&nbsp;</TD>
</TR>
</Table>
<p align="center"><!-- #BeginLibraryItem "/Library/copyright.lbi" --><!-- #BeginLibraryItem "/Library/copyright.lbi" --><font size="1" face="Arial, Helvetica, sans-serif"><strong><font color="#000000">&#169;
2003-2005 Moldex-Metric, Inc. All Rights Reserved.</font> </strong></font><!-- #EndLibraryItem --><!-- #EndLibraryItem -->
<Script>
runslideshow1();
runslideshow2();
runslideshow3();

</Script>


WOLF VIDEO
 
You should look at changing the way you start the animations. The code is most likely failing because it's trying to access elements of a DOM that is not complete (yet). You know a DOM is loaded (and complete) when the document onload event has triggered.

At the end of the code you have posted above, you would replace your 3 function calls with the following code:
Code:
<script type="text/javascript">
if (typeof window.onload == 'function') {
   var _tempOnload = window.onload;
   window.onload = function() {
      _tempOnload();
      runslideshow1();
      runslideshow2();
      runslideshow3();
   }
} else {
   window.onload = function () {
      runslideshow1();
      runslideshow2();
      runslideshow3();
   }
}
</script>
I'm guessing that's all you will need. This code change will work in almost all browsers on all platforms.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
I don't understand - what have I missed? Still, now, the only animation I can see in any browser is the Flash animation. Is there actually another animation on the page?

As to the JS error, you have a function call to "trap()" in the onload tag, but the function "trap" does not exist.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top