Initialize the WProofreader in content-editable <iframe> element using either imperative or declarative notation as it is shown in the examples below.

WProofreader (Imperative Notation):
<iframe id="container3" src="editable_doc.html"></iframe>
 
<script>
    var instance3 = WEBSPELLCHECKER.init({
        container: document.getElementById("container3"),
        autoStartup: true,
		enableGrammar: true,
        lang: 'en_US',
        serviceProtocol: 'https',
        serviceHost: 'your_host_name',
        servicePort: '443',
        servicePath: 'virtual_directory/api'
    });
</script>
WProofreader (Declarative Notation):
<iframe id="container4" data-wsc-autocreate="true" data-wsc-lang="en_US" src="editable_doc.html"></iframe>

<script>
    window.WEBSPELLCHECKER_CONFIG = {
		enableGrammar: true,
        serviceProtocol: 'https',
        serviceHost: 'your_host_name',
        servicePort: '443',
        servicePath: 'virtual_directory/api'
    };
</script>

Editable_doc.html example:
<html>
    <head>
        <title>WProofreader for HTML Editable Controls</title>
    </head>
    <body contenteditable>This sampl text is aimed at demonstrating the work of WProofreader in an iframe element. 
WProofreader will find all your speling and grammar mistakes as you type and suggest how to correct them. 
Type your text here or use this one too see an few of of the problems that SCAYT will recognized. 
Click the underlined words and phras to see the suggestion options for correction.
    </body>
</html>


  • No labels