GetStyles Function

Description

This function retrieves the styling information from the EditLive! for Java applet.  It will retrieve all style information which lies between the <STYLE> tags in the documents <HEAD>.  This function takes the name of a JavaScript function as its only parameter.

Syntax

JavaScript object.GetStyles(jsFunct)

Parameters

jsFunct Required.  The name of the JavaScript function which receives the retrieved EditLive! for Java style information. 

Example

The following code first creates a JavaScript function which is to be used as the parameter for the GetStyles function.  The JavaScript function will save the retrieved style information to a <TEXTAREA> with the name styleInfo.  The GetStyles 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 retrieveStyles(src){
                document.exampleForm.styleInfo.value = src;
            }
        -->
        </SCRIPT>
    </HEAD>
    <BODY>
        <FORM name = exampleForm>
            <P>EditLive! for Java style information will appear here</P>
            <!--Create a textarea to save the applet contents to-->
            <P>
            <TEXTAREA name="styleInfo" cols="40" rows="10"></TEXTAREA>    
            </P>
            <P>Click this button to retrieve applet style information</P>
            <P>
            <INPUT type="button" name="button1" value="Retrieve Styles"
                 onClick="editlivejava1.GetStyles('retrieveStyles');" >
            </P>
            <!--Create an instance of EditLive! for Java-->
            <SCRIPT language="JavaScript">
            <!--
                var editlivejava1;
                editlivejava1 = new EditLiveJava("eljava",450 , 275);
                editlivejava1.setDownloadDirectory("editlivejava");
                editlivejava1.setLocalDeployment(false);
                editlivejava1.setXMLURL("sample_eljconfig.xml");
                editlivejava1.setStyles(escape('body{ font-family: arial; background-color: white;}'));
                editlivejava1.setBody(escape('<p>Some initial text</p>'));
                editlivejava1.show();
            -->
            </SCRIPT>
        </FORM>
    </BODY>
</HTML>

See Also