xunling: menu schreiben

hallo

<html><head><title>^^</title>  
<script type="text/javascript">  
/* write array with cities, write multiarray with "reload" function  
on load write depenndend subclass --s  
  
write laender, sublaender, continents auslagern,  
  
always load depend items from list  
  
first load all continents, all countries  
-> write 5 continents, write 5 countries  
  
--  
position = function Wunsch () {http://txu/ebaai.com/admin/try2.php  
  var Ziel = window.prompt("Ihr Wunsch-URI:", "");  
  window.location.href = Ziel;  
}*/  
function generateLaenderMenu (position) {  
  
 if (position == false)  
  var position = 0;  
  
 var countries = new Array();  
 countries.push("deutschland");  
 countries.push("frankreich");  
 countries.push("spanien");  
 countries.push("england");  
 countries.push("schweden");  
 countries.push("norwegen");  
 countries.push("russland");  
 countries.push("china");  
 countries.push("england");  
 countries.push("deutschland2");  
 countries.push("frankreich2");  
 countries.push("spanien2");  
 countries.push("england2");  
 countries.push("schweden2");  
 countries.push("norwegen2");  
 countries.push("russland2");  
 countries.push("china2");  
 countries.push("england2");  
 countries.push("deutschland3");  
 countries.push("frankreich3");  
 countries.push("spanien3");  
 countries.push("england3");  
 countries.push("schweden3");  
 countries.push("norwegen3");  
 countries.push("russland3");  
 countries.push("china3");  
 countries.push("england3");  
 countries.push("deutschland4");  
 countries.push("frankreich4");  
 countries.push("spanien4");  
 countries.push("england4");  
 countries.push("schweden4");  
 countries.push("norwegen4");  
 countries.push("russland4");  
 countries.push("china4");  
 countries.push("england4");  
  
 var content = "<table width=\"220\" cellpadding=\"4\" cellspacing=\"5\" border=\"1\">";  
 content += "<tr>";  
 content += "  <td>&nbsp;&nbsp;&nbsp;&nbsp;^^^^</td>";  
 content += "</tr>";  
  
 var i = 0;  
 if ((position + 1) * 5 < countries.length) {  
  while (i <= (position + 1) * 5 && i < countries.length) {  
   content += "<tr>";  
   content += "  <td>" + countries[i] + " </td>";  
   content += "</tr>";  
   i ++;  
  }  
 }  
  
 content += "<tr>";  
 content += "  <td><span class=\"style1\" onClick=\"generateLaenderMenu (" + position + 1 + ")\">&nbsp;&nbsp;&nbsp;&nbsp;vvvv</span></td>";  
 content += "</tr>";  
  
 content += "</table>";  
 document.write(content);  
}  
</script>  
<link href="style41.css" rel="stylesheet" type="text/css">  
</head>  
<body>  
<br/>  
<br/>  
<br/>  
<br/>  
<script type="text/javascript">  
generateLaenderMenu(0);  
</script>  
</body></html>  
  
  
  

kann mir jemand bei diesem javascript menu helfen?

Ich moechte, dass ich bei on.click einen opurl aufruf habe, ich kann es nicht hinbekommen, dass sich das menu vernuenftig auf und zu faehrt....

vielen dank
xunling

  1. ach Ja,

    der link zu dem script ist hier: http://l3s7513.zeus07.de/test_menuscripting.html

    und ich denke, dass ich ein schleifenproblem habe, weil der die vm denke ich abstuerzt ...

  2. @@xunling:

    content += "  <td>&nbsp;&nbsp;&nbsp;&nbsp;^^^^</td>";

    Wenn du mehr als einmal '&nbsp;' hintereinander hast, machst du mit Sicherheit etwas falsch. Für Abstände ist CSS zuständig.

    i ++;

    Was sagt die Fehlerkonsole denn dazu? Du benutzt doch zum Testen einen Browser mit Fehlerkonsole, oder?

    […] dass sich das menu vernuenftig auf und zu faehrt....

    Welches Menü? „Da is nix.“ [DIALOG-ROBOT]

    Live long and prosper,
    Gunnar

    --
    Erwebsregel 208: Manchmal ist das einzige, was gefährlicher als eine Frage ist, eine Antwort.
    1. i ++;

      Was sagt die Fehlerkonsole denn dazu?

      Was soll sie dazu sagen? Operand und Operator dürfen durchaus durch Leerzeichen getrennt sein.

      Mathias

      1. @@molily:

        i ++;

        Was sagt die Fehlerkonsole denn dazu?

        Was soll sie dazu sagen? Operand und Operator dürfen durchaus durch Leerzeichen getrennt sein.

        Tja, man lernt nie aus.

        Live long and prosper,
        Gunnar

        --
        Erwebsregel 208: Manchmal ist das einzige, was gefährlicher als eine Frage ist, eine Antwort.
        1. Tja, man lernt nie aus.

          sieht aber komisch aus ;)

    2. content += "  <td>&nbsp;&nbsp;&nbsp;&nbsp;^^^^</td>";
      Wenn du mehr als einmal '&nbsp;' hintereinander hast, machst du mit Sicherheit etwas falsch. Für Abstände ist CSS zuständig.

      fürs protokoll: auch wenn &nbsp; anfang oder ende text textes steht oder z.b. an ein leerzeichen angrenzt