Share via


Deferred initialization of SpeechKit

If you implement the NUSA_configure() function to set up Dragon Medical SpeechKit as described in Speech enabling your browser app, Dragon Medical SpeechKit will call NUSA_configure() from the page's onload event, and Dragon Medical SpeechKit will parse the web page to speech-enable its edit controls at this point in time. If any edit controls are added to the web page later, they won't be speech-enabled.

To initialize Dragon Medical SpeechKit independently from the onload event, don't declare a NUSA_configure() function. Instead, proceed as follows:

Providing the user name and app name

When your page is ready to be speech-enabled, make sure the variables for initializing and configuring Dragon Medical SpeechKit are set correctly and globally available. For deferred initialization, don't use NUSA_configure().

NUSA_userId = "<user name>";
NUSA_applicationName = "<your application name>";

User names and app names can have a maximum of 75 characters.

Initializing Dragon Medical SpeechKit

Call NUSA_initialize() - Dragon Medical SpeechKit parses the page to speech-enable all supported edit controls.

Optional: You can pass a container DOM element: NUSA_initialize(container); this can be a parent element of speech-enabled elements or an array of speech-enabled elements (see Dynamically modified controls).

Dynamic loading of Dragon Medical SpeechKit

If you need to load Dragon Medical SpeechKit dynamically, create a <script> element and add it to your page. For example:

function loadScriptDynamically()
    {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "https://speechanywhere.nuancehdp.com/<channel>/scripts/Nuance.SpeechAnywhere.js";
    document.getElementsByTagName("head")[0].appendChild(script);
    }