chris: DIASHOW Syntax-Fehler? IE, OP, NS

Hi,

könnt Ihr mir helfen?
Habe eine Diashow mit Javascript erstellt, funzt aber nicht richtig!
Geht nur im IExplorer und das auch nicht bei jedem und im Netscape, Mozilla und Opera zeigt er überhaupt kein Bild an. Lediglich die Buttons.
Sind da irgendwo Syntaxfehler?
Könnts Euch auch auf www.mtevents.de und Bilder anschauen!
danke für Eure Hilfe:
(und wisst ihr, wie ich die Dateinamen zusammenschmeissen kann, so dass er, wenn ich die Gesamtzahl angebe sich selber die Bilder zieht)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>Diashow</title>
<link rel="stylesheet" type="text/css" href="../../../style1.css">
<script language="javascript" type="text/javascript">
var bilder=new Array(
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_001.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_002.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_003.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_004.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_005.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_006.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_007.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_008.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_009.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_010.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_011.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_012.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_013.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_014.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_015.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_016.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_017.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_018.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_019.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_020.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_021.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_022.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_023.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_024.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_025.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_026.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_027.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_028.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_029.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_030.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_031.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_032.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_033.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_034.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_035.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_036.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_037.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_038.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_039.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_040.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_041.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_042.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_043.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_044.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_045.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_046.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_047.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_048.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_049.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_050.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_051.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_052.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_053.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_054.JPG",
"../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_055.JPG")
var bild=0
var gesamt=55
var zaehler=gesamt-1
function start() {
   if (document.images && bild<zaehler) {
       bild
       document.pBild.src=bilder[bild]
   }
}
function zurück() {
  if (document.images && bild>0) {
      bild--
      document.pBild.src=bilder[bild]
      document.total.itotale.value=bild+1 + " von " + gesamt;
      document.total.itotale.value="Bild " + document.total.itotale.value;
  }
}
function weiter() {
   if (document.images && bild<zaehler) {
       bild++
       document.pBild.src=bilder[bild]
       document.total.itotale.value=bild+1 + " von " + gesamt;
       document.total.itotale.value="Bild " + document.total.itotale.value;
   }
}
function zaehlen() {
   document.total.itotale.value=bild+1 + " von " + gesamt;
   document.total.itotale.value="Bild " + document.total.itotale.value;
}
</script>
</head>
<body>
<p align="center" style="margin-top: 0; margin-bottom: 0">
<img SRC="javascript:start()" NAME="pBild" WIDTH="640" HEIGTH="480"></p>
<table border="0" width="640" height="35" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100" height="35" valign="middle"> </td>
<td width="440" height="35" valign="middle" align="center">
<p><a href="javascript:zurück()"><img src="../../../images/zurueck.gif" border="0" width="90" height="30"></a>
 
<a href="javascript:window.close()"><img src="../../../images/schliessen.gif" width="30" height="30" border="0"></a>
 
<a href="javascript:weiter()"><img src="../../../images/weiter.gif" border="0" width="90" height="30"></a></p></td>
<td width="100" height="35" valign="middle" align="right">
<p><form name="total">
<input type="text" name="itotale" size="14 readOnly">
</form>
<script>zaehlen()</script></p></td></tr></table>
</body>
</html>

  1. Hallo,

    hinter die Javascriptstatemments gehört ein ";". Ich glaube, bei dem letzten in einem Block kann man es weglassen, ich rate aber davon ab. Der Javascriptbereich wird mit "<script type="text/javascript">" eingeleitet.

    Gruß,     Jürgen

    1. Wo habe ich es vergessen oder wo genau gehört eins hin?
      Und so kann man es nicht schreiben?
      <script language="javascript" type="text/javascript">

      danke chris

  2. Hi,

    könnt Ihr mir helfen?
    Habe eine Diashow mit Javascript erstellt, funzt aber nicht richtig!
    Geht nur im IExplorer und das auch nicht bei jedem und im Netscape, Mozilla und Opera zeigt er überhaupt kein Bild an. Lediglich die Buttons.
    Sind da irgendwo Syntaxfehler?

    Du kannst MZ oder NC benutzen?
    Nein?
    Denn diese beiden zeigen dir in der Regel sehr genau an was falsch ist http://glasgoogle.de hilft dir weiter.

    Denn das ist der Fehler denNEtscape 4.5 anzeigt:
    JavaScript Error:
    http://www.mtevents.de/community/bilder/diashow/d0301sharkkoenigshofen1.htm,
    line 75:

    missing ( before formal parameters.

    function zurück() {
    ............^

    (und wisst ihr, wie ich die Dateinamen zusammenschmeissen kann, so dass er, wenn ich die Gesamtzahl angebe sich selber die Bilder zieht)

    Du hast schonmal von Arrays gehört?

    <script language="javascript" type="text/javascript">

    var bilder = new Array();

    function setBilder(anzahl, datei)
    {
      for(var i = 0; i < anzahl; i++)
       bilder[i] = datei + '_' + getNr(i) + '.jpg';
    }
    function getNr(nr, length)
    {
        if(!length) length = 3;
        nr += '';
        for(var i = nr.length; i < length; i++) nr = '0' + nr;
        return nr;
    }
    // 50 Bilder
    setBilder(50, "../../../bilder/0301sharkkoenigshofen/teil1/koenigshofen_03-01-03_");

    Struppi.