Change() method


Elements/Objects that the method can be called on

 

Example

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
    <title>Prompt control</title>
    <head>
        <script>
            function checkKWBargein() {
                if (keyword.value == "") { // result is below threshold
                    news.change(1.0, 2.0); // restore the volume
                    keyword.Start(); // restart the recognition
                } else {
                    PromptQueue.Stop(); // keyword detected! Stop the prompt
                    // Do whatever that is necessary
                }
            }
        </script>
        <script for="window" event="onload">
            news.Start(); keyword.Start();
        </script>
    </head>

     <body>
        <salt:prompt id="news"
                bargein="false"
                onbargein=" news.change(1.0, 0.5);" >
                <!-- onbargein... turns down the volume while verifying -->
            Stocks turned in another lackluster performance Wednesday as
            investors received little incentive to make any big moves ahead
            of next week's Federal Reserve meeting. The tech-heavy Nasdaq
            Composite Index dropped 42.51 points to close at 2156.26.
            The Dow Jones Industrial Average fell 17.05 points to
            10866.46 after an early-afternoon rally failed.
            <!--
                More to follow
            -->
        </salt:prompt>

         <salt:listen id="keyword"
                reject="70"
                onreco="checkKWBargein()"
                onnoreco="checkKWBargein()" >
            <salt:grammar src="grams/news_bargein_grammar.grxml" />
        </salt:listen>
    </body>
</html>

 

Extra info

For details on usage of this element, see the SALT Specification, Version 1.0.