You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Initialize the WebSpellChecker Proofreader functionality in <iframe> element using either imperative or declarative notation as it is shown in the examples below.

WebSpellChecker Proofreader (Imperative Notation):
<iframe id="container1" src="editable_doc.html"></iframe>
 
<script>
    var instance1 = WEBSPELLCHECKER.init({
        container: document.getElementById("container1"),
        autoStartup: true,
		enableGrammar: true,
        lang: 'en_US',
        serviceProtocol: 'https',
        serviceHost: 'svc.webspellchecker.net',
        servicePort: '443',
        servicePath: 'spellcheck31/script/ssrv.fcgi',
        serviceId: 'encrypted-service-ID'
    });
</script>
WebSpellChecker Proofreader (Declarative Notation):
<iframe id="container2" data-wsc-autocreate="true" src="editable_doc.html"></iframe>

<script>
    window.WEBSPELLCHECKER_CONFIG = {
		enableGrammar: true,
        lang: 'en_US',
        serviceProtocol: 'https',
        serviceHost: 'svc.webspellchecker.net',
        servicePort: '443',
        servicePath: 'spellcheck31/script/ssrv.fcgi',
        serviceId: 'encrypted-service-ID'
    };
</script>

Editable_doc.html example:
<html>
    <head>
        <title>WebSpellChecker Proofreader for Editable Controls</title>
    </head>
    <body contenteditable>This sampl text is aimed at demonstrating the work of SCAYT in a plain textarea element. SCAYT 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