IE/MAC will not display this script? (OK using Safari + all browsers on PC)

Discussion in 'JavaScript' started by mejust, May 15, 2006.

  1. #1
    Hi all....

    The following Javascript does not seem to work using IE on a MAC. The images do not display. Seems to work OK using Safari and all browsers on a PC.

    The script creates a slideshow of images.

    Any suggestions? Much appreciated!....

    <script type="text/javascript"><!--
    function GotoPic(Num){
    location.href=location.pathname+'?'+Num;
    }

    N=-1;Picture=new Array;
    N++;Picture[N]="imagename.jpg";
    N++;Picture[N]="imagename2.jpg";
    N++;Picture[N]="imagename3.jpg";
    N++;Picture[N]="imagename4.jpg";

    var ThisPic;
    var PrevPic;
    var NextPic;
    var ShowPrev;
    var ShowNext;

    if (location.search){
    ThisPic=location.search.substring(1)*1;
    }else{
    ThisPic=0;
    }

    NextPic=ThisPic+1;ShowNext=(NextPic>(Picture.length-1)?false:true);
    PrevPic=ThisPic-1;ShowPrev=(PrevPic<0?false:true);

    if (ShowPrev){
    document.writeln('<a href="javascript:GotoPic(PrevPic)"><img src="navigation/previous.jpg" width="75" height="23" border="0"></a><img src="navigation/blank.jpg"> ');
    }
    if (ShowNext){
    document.writeln('<a href="javascript:GotoPic(NextPic)"><img src="navigation/next.jpg" width="37" height="23" border="0"></a> ');
    }
    document.write('</P><img src="'+Picture[ThisPic]+'">');
    // -</script>
     
    mejust, May 15, 2006 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Those HTML comments are incorrect and in any case not needed. Try removing them.
    This is unnecessarily complicated.

    Picture=["imagename.jpg","imagename2.jpg", ....];
     
    Logic Ali, May 15, 2006 IP
  3. mejust

    mejust Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks. Still not working in IE/MAC though :-(
    Any other ideas?
     
    mejust, May 16, 2006 IP
  4. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Are you getting any error messages in the JS console?
     
    Logic Ali, May 16, 2006 IP
  5. mejust

    mejust Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Cant seem to find any alert using IE/MAC. I turned on the Script Error option but nothing comes up. Perhaps I am looking in the wrong place - will keep looking.

    A live version of the site can be found here (in case this helps):

    -edited-

    And here is a page (one of many) using the script itself:

    -edited-
     
    mejust, May 17, 2006 IP
  6. mejust

    mejust Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This issue has now been resolved.

    Thank you for your help.

    http://forums.htmlcenter.com/showthread.php?p=9946
     
    mejust, May 17, 2006 IP