This function obtains a count of the number of characters present within the EditLive! for XML applet. It counts the number of characters which are contained within controls on the current view. This function takes the name of a JavaScript function as its only parameter.
The name of the function which receives the character count obtained from the EditLive! for XML applet.
Example 17.1. GetCharCount Runtime Function 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 XML applet in a JavaScript alert dialog. The GetCharCount function will be associated with a HTML button. The name of the EditLive! for XML applet is editlivejs.
<html>
<head>
<title>EditLive! for XML JavaScript Example</title>
<!--Include the EditLive! for XML JavaScript Library-->
<script src="editlivexml/editlivexml.js" language="JavaScript">
</script>
<script language="JavaScript">
function charCountAlert(src){
alert('Character Count: '+src);
}
</script>
</head>
<body>
<form name="exampleForm">
<h1>Instance of EditLive! for XML</h1>
<script language="JavaScript">
var editlivejs;
editlivejs = new EditLiveXML("editlive",600 , 400);
editlivejs.setDownloadDirectory("editlivexml");
editlivejs.setLocalDeployment(false);
editlivejs.setConfigurationFile("sample_elconfig.xml");
editlivejs.setDocument(escape('<p>There are 51 characters in
this instance of EditLive! for XML</p>'));
editlivejs.show();
</script>
<br/>
<p>Click this button to obtain a character count</p>
<input type="button" value="Character Count"
onClick="editlivejs.GetCharCount('charCountAlert');"/>
</form>
</body>
</html> Copyright 2001-2004 Ephox Corporation. All Rights Reserved.