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

SCAYT 3 (Imperative Notation):
<iframe id="container2" src="editable_doc.html"></iframe>
 
<script>
    var iframeInstance;
    var iframeElement = document.getElementById("container2");
 
    SCAYT.SCAYT.createScaytControl(iframeElement, {
            container: document.getElementById("container1"),
            autoStartup: true,
            spellcheckLang: 'en_US',
            serviceProtocol: 'https',
            serviceHost: 'svc.webspellchecker.net',
            servicePort: '443',
            servicePath: 'spellcheck31/script/ssrv.cgi',
            customerId: 'encrypted-customer-ID'
        },
        function(instance) {
            iframeInstance = instance;
        }
    );
</script>
SCAYT 3 (Declarative Notation):
<script>
    window.SCAYT_CONFIG = {
        spellcheckLang: 'en_US',
 	    serviceProtocol: 'https',
        serviceHost: 'svc.webspellchecker.net',       
        servicePort: '443',
        servicePath: 'spellcheck31/script/ssrv.cgi',
        customerId: 'encrypted-customer-ID'
    };
</script>
 
<iframe id="container2" data-scayt-autocreate="true" src="editable_doc.html"></iframe>

/*Editable_doc.html example: */
 
<html>
	<head>
		<title>SCAYT for Editable Controls</title>
    </head>
      <body contenteditable>This is an exampl of a sentence with two mispelled words. Just type text with misspelling to see how it works.
      </body>
</html>

  • No labels