GetCharCount Function

Description

This function obtains a count of the number of characters present within the EditLive! for Java applet.  It counts the number of characters which lie between the <BODY> tags.  This function takes the name of a JavaScript function as its only parameter.

Syntax

JavaScript object.GetCharCount(jsFunct)

Parameters

jsFunct Required.  The name of the function which receives the character count obtained from the EditLive! for Java applet.

Example

The following code first creates a JavaScript function which is to be used as the parameter for the GetCharCount function.  The JavaScript function will display the character count of the EditLive! for Java applet in a JavaScript alert dialogThe GetCharCount function will be associated with a HTML button.  The name of the EditLive! for Java applet is editlivejava1.

<HTML>
    <HEAD>
        <TITLE>EditLive! for Java JavaScript Example</TITLE>
        <!--Include the EditLive! for Java JavaScript Library-->
        <SCRIPT src="editlivejava/editlivejava.js" language="JavaScript"></SCRIPT>
        <SCRIPT language="JavaScript">
        <!--
            function charCountAlert(src){
                alert('Character Count: '+src);
            }
        -->
        </SCRIPT>
    </HEAD>
    <BODY>
        <FORM name = exampleForm>
            <!--Create an instance of EditLive! for Java-->
            <H1>Instance of EditLive! for Java</H1>
            <SCRIPT language="JavaScript">
            <!--
                var editlivejava1;
                editlivejava1 = new EditLiveJava("eljava",600 , 400);
                editlivejava1.setDownloadDirectory("editlivejava");
                editlivejava1.setLocalDeployment(false);
                editlivejava1.setXMLURL("sample_eljconfig.xml");
                editlivejava1.setBody(escape('<p>There are 51 characters in this instance of EditLive! for Java</p>'));
                editlivejava1.show();
            -->
            </SCRIPT>
            <BR>
            <P>Click this button to obtain a character count</P>
            <INPUT type="button" value="Character Count"
                onClick="editlivejava1.GetCharCount('charCountAlert');">
        </FORM>
    </BODY>
</HTML>

See Also