Announcement

Collapse
No announcement yet.

Problem IE / Firefox

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

  • Problem IE / Firefox

    Hallo,

    ich habe folgendes Problem. Ich habe ein HTML Seite (index.html) die ein IFrame (iframe.html) beinhaltet. Innerhalb des IFrames möchte ich auf die "Ursprungsseite" auf der das IFrame eingebunden ist zugreifen.

    Dazu habe ich einen Button auf iframe.html

    Code:
    <input type="button" name="Text 3" value="Text 3 anzeigen"
          onclick="alert(parent.fat.getStatus());">
    Nur zur info fat ist ein Applet, hat jedoch für das Problem keine Relevanz!

    Klicke ich im IE auf den Button klappt alles perfekt! Klicke ich im Firefox (2.0.0.15) auf den Button erhalte ich ein:

    parent.fat has no properties
    Ein Alternativer Aufruf über
    Code:
    <input type="button" name="Text 3" value="Text 3 anzeigen"
          onclick="alert(parent.applets['fat'].getStatus());">
    läuft weder im IE noch im Firefox.

    Kann mir jemand sagen wo das Problem liegt, und wichtiger wie ich es beheben kann?

    Anscheinend kann Firefox über parent nicht auf das darüberliegende Frame zugreifen? Es soll aber für beide Browser laufen.

  • #2
    Hab die Lösung gerade selbst gefunden.

    Ein parent.document.fat. .... funktioniert sowohl im IE als auch im FF wunderbar.

    Jetzt habe ich aber noch eine Frage: Kann JavaScript sich selbst ausführen?

    Ich stelle mir das so vor:

    Code:
    function runCommand(command){
    if (document.fat){
      command ??????
    }else{
      alert("Applet not found");
    }
    }
    Als parameter würde ich zb. übergben

    document.fat.getStatus();

    Comment


    • #3
      Hallo,

      JavaScript kennt die Funktion eval() zum Ausführen von JS-Code.

      [highlight=javascript]
      function runCommand(command) {
      if (document.fat){
      eval(command);
      }
      else{
      alert("Applet not found");
      }
      }
      [/highlight]

      Gruß Falk
      Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

      Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

      Comment

      Working...
      X