EditLive! 9 Documentation : setDocument Method

This property specifies the initial document contents of the Tiny EditLive! applet.

When setting this property it should be noted that, when provided with a document, all the information from the document (everything between the <HTML> and </HTML> tags) will be placed inside the instance of EditLive!. This property is mutually exclusive with the setBody Method.

Syntax

Visual Basic Script
object.Document = strDocument
ASP.NET

This attribute no longer exists in the ASP.NET controls. Please use the Content property and the Styles property instead.

JavaScript
editliveInstance.setDocument(strDocument);

Parameters

strDocument

A string specifying the initial document contents of the EditLive! applet.

The default value is an empty string.

Examples

The following code would set the initial document contents of EditLive! to be equal to Initial contents of Tiny EditLive!

The HTML tags will not be seen in the window as they will be parsed as HTML. However, these tags will be visible in the Code View option of the EditLive! applet. Also, the title of the document (also only be visible in Code View) will be set to Example.

VBScript
editlive1.Document = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>
<BODY><P>Initial contents of Tiny EditLive!</P></BODY></HTML>"
ASP.NET Server Control
<elj:EditLiveJava 
  ...
  Document = "<HTML><HEAD><TITLE>Example</TITLE></HEAD>
<BODY><P>Initial contents of Tiny EditLive!</P></BODY></HTML>" 
  ... 
/>
JavaScript
editlivejs.setDocument(encodeURI("<HTML><HEAD><TITLE>Example</TITLE></HEAD>
<BODY><P>Initial contents of Tiny EditLive!</P></BODY></HTML>"));

The string passed to the JavaScript setDocument property must be URL encoded. It is recommended that a server-side URL encoding function be used if available as the JavaScript URL encoding functions do not fully comply with the URL encoding standard.

Remarks

The Document property is mutually exclusive with the setBody Method.