HighDots Forums  

"Edit mode" im Mozilla?

Javascript (German) Programmiersprache JavaScript. (de.comp.lang.javascript)


Discuss "Edit mode" im Mozilla? in the Javascript (German) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Konni Scheller
 
Posts: n/a

Default "Edit mode" im Mozilla? - 02-06-2008 , 02:01 PM






Hallo,

ich kann mich noch erinnern, da konnte man Mozilla/Firefox mit einem
seltsamen Javascript-Teil dazu bringen, Textareas in einem besonderen
Modus zu bearbeiten, in dem die Texte bereits HTML-Formatiert
dargestellt wurden.

Gibt es dazu irgendwo Doku und wie heißt das ganze?

Servus,
Konni

--
Inzwischen ohne Signatur

Reply With Quote
  #2  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: "Edit mode" im Mozilla? - 02-06-2008 , 02:06 PM






Konni Scheller wrote:
Quote:
ich kann mich noch erinnern, da konnte man Mozilla/Firefox mit einem
seltsamen Javascript-Teil dazu bringen, Textareas in einem besonderen
Modus zu bearbeiten, in dem die Texte bereits HTML-Formatiert
dargestellt wurden.

Gibt es dazu irgendwo Doku und wie heißt das ganze?
http://developer.mozilla.org/en/docs...ent.designMode


PointedEars
--
Quote:
Einfach die xml Tags durch html Code ersetzen und gut...
Lass es mich so sagen: Die dunkle Seite gewählt Du hast. Den schnellen
Erfolg Du suchst, aber auf die Füsse fallen die Komplexität Dir wird.
Unterschätze niemals die Bugs der dunklen Seite! -- Geggo in fcc


Reply With Quote
  #3  
Old   
Konni Scheller
 
Posts: n/a

Default Re: "Edit mode" im Mozilla? - 02-06-2008 , 03:06 PM



Thomas 'PointedEars' Lahn <PointedEars (AT) web (DOT) de> wrote:

Danke. Da steht nicht allzuviel:

"use in a iframe. iframe.document.designMode = "on"; you can get the
iframe text with iframe.document.body.innerHTML"

Dann hab ich mal ein Dokument gebastelt:

<h1>Test des "Designmodes"</h1>
<iframe src="text.html" width="90%" height="400" name="editor"
id="editor"></iframe>

Im Javascript-Bereich dann:

var iframe = document.getElementById('editor');
iframe.document.designMode = "on";

und iframe.document ist bereits undefined.

Hab ich hier was falsch verstanden?

Servus,
Konni

--
Inzwischen ohne Signatur


Reply With Quote
  #4  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: "Edit mode" im Mozilla? - 02-06-2008 , 03:23 PM



Konni Scheller wrote:
Quote:
h1>Test des "Designmodes"</h1
iframe src="text.html" width="90%" height="400" name="editor"
id="editor"></iframe

Im Javascript-Bereich dann:

var iframe = document.getElementById('editor');
iframe.document.designMode = "on";

und iframe.document ist bereits undefined.

Hab ich hier was falsch verstanden?
Ja. document.getElementById() liefert Dir nur die Referenz zum
Elementobjekt, welches keine document-Eigenschaft hat, siehe

http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-50708718

Gemeint ist hier mit `iframe' das entsprechende Window-Objekt, also entweder
komplett proprietär mit DOM Level 0:

var iframe = window.frames["editor"];

oder bis auf `designMode' standardkonform:

iframe.contentDocument.designMode = "on";


PointedEars
--
gibt es Variablen, die in allen gängigen Browsern funktionieren?
(Patrick Fiekers in dcljs <am7bvc$3bg2l$1 (AT) ID-83673 (DOT) news.dfncis.de>)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.