Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The following code creates a <TEXTAREA>, named documentContents, that will have its contents loaded into an instance of EditLive! via the setDocument method. The setDocument method will be associated with a HTML button. The name of the EditLive! applet is editlivejs.

Code Block
HTML
HTML
linenumberstrueHTML
<HTML>
   <HEAD>
      <TITLE>EditLive! JavaScript Example</TITLE>
      <!--Include the EditLive! JavaScript Library-->
      <SCRIPT src="editlivejava/editlivejava.js" language="JavaScript">
      </SCRIPT>
   </HEAD>
   <BODY>
      <FORM name = exampleForm>
         <P>EditLive! contents will be loaded from here</P>
         <!--Create a textarea to load the applet contents from-->
         <P>
            <TEXTAREA name="documentContents" cols="40" rows="10">
               <html><body><p>Content to be loaded</p></body></html>
            </TEXTAREA>
         </P>
         <P>Click this button to set applet contents</P>
         <P>
            <INPUT type="button"
               name="button1"
               value="Set Contents"
               onClick="editlivejs.setDocument(encodeURI(document.exampleForm.documentContents.value));">
         </P>
         <!--Create an instance of EditLive!-->
         <SCRIPT language="JavaScript">
            var editlivejs;
            editlivejs = new EditLiveJava("editlive", 450, 275);
            editlivejs.setConfigurationFile("sample_config.xml");
            editlivejs.show();
         </SCRIPT>
      </FORM>
   </BODY>
</HTML> 

...