XUL Programmer's Reference Manual

<editor> Attributes

Attributes Common Children
id * * *
type  
name  
src  
flex  
onblur  
onfocus  

<editor> is a functional, embeddable widget that provides editing functionality to the user. Use the src attribute to load content into the editor window (including src="about:blank") to specify a new, blank page for editing. And see the types specified in NS6 to familiarize yourself with blah blah..
 

 

type
Description
type is an optional attribute that specifies the type of content window.
Syntax
<editor type="type" ...>

Example
<editor type="content-primary" id="main-window">

Notes
"content-primary" is the type used for the main editor in Netscape 6. Just as the class attribute affects the way that the chrome is rendered, the type attribute affects the way that the content is treated in the browser. Different editor types appearing in the Mozilla browser include:
  • content-primary denotes the main editor window
  • content is another common type for Composer-like editors in the Mozilla application

 


 

name
Description
name is an optional attribute that specifies the name of content window.
Syntax
<editor name="name" ...>

Example
<editor name="content-primary" id="main-window">

Notes
The name attribute is used instead of the id to reference a content window from other parts of the chrome, as when a button loads new content by changing the attribute on the named editor:

 
<editor name="main-editor">

...

function loadPage() {
  ed = document.getElementById("main-editor")
  ed.setAttribute("src", "newpagetoedit.html")
}

You cannot fetch content window (i.e. getElementById(id)) using the id attribute.


 


 

src
Description
src is the attribute used to load content into the content window.
Syntax
<editor src="HTML content file" ...>

Example
<editor id="main-window" src="about:blank">

Notes
Use JavaScript to set the src attribute from the UI:

 
<editor name="main-editor">

...

function loadPage() {
  ed = document.getElementById("main-editor")
  ed.setAttribute("src", "newpagetoedit.html")
}


 


 

onblur
Description
onblur is an event listener attribute for handling the event raised when the editor loses focus.
Syntax
<element onblur="javascript event handler code">
Example
<editor onblur="blurWindow()">
Notes
None.


 

onfocus
Description
onfocus is an event listener attribute for handling the event raised when the editor gets focus from the user.
Syntax
<element onfocus="javascript event handler code">
Example
<editor onblur="focusWindow()">
Notes
None.


 


 
 

Last updated: 5/25/00 Ian Oeschger