[JavaScript] onclick Javascript & PHP

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Cuupa, 4. Februar 2009 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 4. Februar 2009
    onclick Javascript & PHP

    Hi @ all,

    ich habe ein kleines Problem mit Javascript und auch stundenlanges googlen hat nichts gebracht.
    Mein Problem ist, das das onclick=\"aboutMeBack();\" nicht funktioniert, aber die restlichen JS schon (habe sie hier nicht aufgeführt). Wenn jemand von euch eine Idee hat wäre ich sehr dankbar :]



    PHP:
    [...]
    echo 
    "function aboutMeBack()
            {
                document.getElementById('aboutMeBack').style.display = 'none';
                document.getElementById('settingsContent').innerHTML = 'Über mich';
            }


    <img onclick=\"aboutMeBack();\" id=\"aboutMeBack\" src=\"./sys/gfx/btn/kr_ba.png\" onmouseover=\"this.src='./sys/gfx/btn/kr_ba_h.png';\" onmouseout=\"this.src='./sys/gfx/btn/kr_ba.png';\" style=\"width:30px; height:30px;\" alt=\"\" />

    <p id=\"settingsContent\" style=\"top:60px; left:20px; right:10px; position:absolute; height: 65%;\" onclick=\"aboutMeShow();\"></p>
    "
    ;



    MfG
    Cuupa
     
  2. 4. Februar 2009
    PHP:
    <script type="text/javascript">
     function aboutMeBack() {
      alert('i do random stuff.');
     }
    </script>

    <?php
    echo  "<img onclick=\"aboutMeBack();\" id=\"aboutMeBack\" src=\"./sys/gfx/btn/kr_ba.png\" onmouseover=\"this.src='./sys/gfx/btn/kr_ba_h.png';\" onmouseout=\"this.src='./sys/gfx/btn/kr_ba.png';\" style=\"width:30px; height:30px;\" alt=\"\" />

    <p id=\"settingsContent\" style=\"top:60px; left:20px; right:10px; position:absolute; height: 65%;\" onclick=\"aboutMeShow();\"></p>
    "

    ?>
    ? du solltest die JS funktion auch in JS einbetten.
     
  3. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.