Problem bei nem kleinen Script.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem bei nem kleinen Script.

    Hallo,
    hab nen kleines Script was bei einem onMouseOver verschiedene Bilder austauschen soll (in dem Fall erstmal nur eins), aber es funktuniert nicht und es kommt auch keine Fehlermeldung, kann mir vielleicht einer sagen was daran falsch ist?

    PHP Code:
    <?php
    $zeile 
    '';
    echo 
    "<a href=\"link.htm\" onMouseOver=".$zeile '2'.
    onMouseOut="
    .$zeile ''.">
    <img src=\"img/headline"
    .$zeile."_button.gif\"  width=\"255\" height=\"27\" border=\"0\"></a>";
    ?>
    Gruß,
    manuelone

  • #2
    zeig doch mal die ausgabe, dann siehst du es auch selbst.

    Comment


    • #3
      *move* 2 html/js
      INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


      Comment


      • #4
        ich seh nur folgendes wenn ich die datei/script ausführe:

        Code:
        "; ?>
        also stimmt da irgendwas net

        Comment


        • #5
          was steht im QUELLCODE?

          Comment


          • #6
            PHP Code:
            <html>
            <head>
            </head>
            <body>
            <?php
            $zeile 
            '';
            echo 
            "<a href=\"link.htm\" onMouseOver=".$zeile '2'." onMouseOut=".$zeile ''.">
            <img src=\"img/headline"
            .$zeile."_button.gif\" width=\"255\" height=\"27\" border=\"0\"></a>";

            ?>
            </body>
            </html>

            Comment


            • #7
              anders gesagt - was wird dem browser übermittelt?

              Comment


              • #8
                .
                Last edited by manuelone; 18-04-2005, 19:25.

                Comment


                • #9
                  das ist die ausgabe:
                  Code:
                  <html>
                  <head>
                  </head>
                  <body>
                  <a href="link.htm" onMouseOver=2 onMouseOut=>
                  <img src="img/headline_button.gif" width="255" height="27" border="0"></a>
                  </body>
                  </html>

                  Comment


                  • #10
                    und das findest du ok?
                    Code:
                    onMouseOver=2 onMouseOut=>

                    Comment


                    • #11
                      nein finde ich nicht, aber ich weis nicht wie ich es ändern muss damit es richtig ist.

                      Comment


                      • #12

                        http://www.google.de/search?hl=de&q=...ouseover&meta=

                        und ähnliches.

                        Comment


                        • #13
                          okay, aber das behebt nur indirekt mein problem - also kann der ansatz von mir grundsätzlich nicht funktunieren oder was?

                          Comment


                          • #14
                            Original geschrieben von manuelone
                            okay, aber das behebt nur indirekt mein problem - also kann der ansatz von mir grundsätzlich nicht funktunieren oder was?
                            Du sagst es.

                            Du bist dir ja nicht einmal im Klaren, wann der PHP-Teil und wann das Javascript ausgeführt wird.

                            de.wikipedia.org/wiki/PHP
                            de.wikipedia.org/wiki/Javascript

                            Comment


                            • #15
                              Für nur 2 Bilder brauchst Du doch auch gar kein PHP...
                              Dein Code kann nicht funktionieren, weil ein Techtelmechtel zwischen zwei unterschiedlichen Sprachen eine Subraumanomalie auslöst

                              Ich weiß ja nicht, was Du eigentlich genau bezweckst, aber als Knopflöser hilft das vielleicht:
                              PHP Code:
                              <?php
                              $pic1 
                              mt_rand(1,5) . ".gif";
                              $pic2 mt_rand(1,5) . ".gif";
                              ?>
                              <a href="blablub.htm"
                              onMouseOver="document.namex.src='<?php echo $pic1?>';return true"
                              onMouseOut="document.namex.src='<?php echo $pic2?>'; return true">
                              <img name="namex" src="example.gif" border="0">
                              </a>
                              ... naja. Hauptsache, es kommt rüber, was gemeint ist.

                              LG,
                              C8H10N4O2 *schlafen geht*

                              edit: glatt noch vergessen: Auf " und \" muß latürnich auch geachtet werden, wenn man gleich alles ins echo packen will... da ist in Deinem Code alles durcheinander.

                              PHP Code:
                              <?php
                              $pic1 
                              mt_rand(1,5) . ".gif";
                              $pic2 mt_rand(1,5) . ".gif";
                                  echo 
                              "
                                  <a href=\"link.htm\"
                                  onMouseOver=\"document.namex.src='"
                              .$pic1."';return true\"
                                  onMouseOut=\"document.namex.src='"
                              .$pic2."'; return true\">
                                  <img name=\"namex\" src=\"example.gif\" border=\"0\">
                                  </a>
                                  "
                              ;
                              ?>
                              Last edited by C8H10N4O2; 20-04-2005, 04:41.

                              Comment

                              Working...
                              X