Horst Scheibenhofer: document.prototype

Hallo!

Ist es möglich, dass der IE 6 ein Document.prototype.myFunction=.... nicht versteht?
Fehler:
"Document.prototype" is null or not an object!
Mit dem FF geht das wunderbar.

Aber mit anderen Objekten geht das prototyping, bild ich mir zumindest ein.

Wird prototyping in SelfHTML behandelt? Ich find da nix.

mfg
  Horst

  1. hi,

    Wird prototyping in SelfHTML behandelt? Ich find da nix.

    CK beleuchtet das ganz gut in seinem feature-artikel Objekt-Handling in JavaScript.

    gruß,
    wahsaga

    --
    /voodoo.css:
    #GeorgeWBush { position:absolute; bottom:-6ft; }
  2. Ist es möglich, dass der IE 6 ein Document.prototype.myFunction=.... nicht versteht?
    Fehler:
    "Document.prototype" is null or not an object!
    Mit dem FF geht das wunderbar.

    Wenn überhaupt document, JS ist case sensitive.

    Wobei du aber nicht allen Objekten prototypen zu fügen kannst, ich halte es für document auch für sinnlos, da du ja nicht mit new document() eine neue Instanz erzeugen kannst.

    Struppi.

    1. Ist es möglich, dass der IE 6 ein Document.prototype.myFunction=.... nicht versteht?
      Fehler:
      "Document.prototype" is null or not an object!
      Mit dem FF geht das wunderbar.

      Wenn überhaupt document, JS ist case sensitive.

      Hab ich mir eigentlich auch gedacht. Aber ich hab mir ein paar Beispiele ergoogelt und oft wars groß geschrieben.

      mfg
      Horst

    2. Hallo,

      Ist es möglich, dass der IE 6 ein Document.prototype.myFunction=.... nicht versteht?

      Nicht das ich wüsste. Wenn auch HTMLDocument nicht klappt, sieht es schlecht aus. Sowieso würde mich auch interessieren, warum du das vorhast.

      Fehler:
      "Document.prototype" is null or not an object!
      Mit dem FF geht das wunderbar.

      Wenn überhaupt document, JS ist case sensitive.

      Document ist schon richtig, weil das Objekt Document nicht mit document identisch ist, sondern sich auf das DOM-Interface Document bezieht. Analog dazu gibt es Node, Element, Attr, Text, Comment usw. sowie HTMLDocument, HTMLElement usw. aus dem HTML-DOM.

      Wobei du aber nicht allen Objekten prototypen zu fügen kannst, ich halte es für document auch für sinnlos, da du ja nicht mit new document() eine neue Instanz erzeugen kannst.

      Naja, schon (Im IE entsprechend über ActiveXObject).

      Mathias