|
Newsletters
|
|
|
|
|
Voice XML Reference
Voice XML Reference
Bookmark this page
The script Element - <script>
Description: The <script> element allows the specification of a block of client-side scripting language code,
and is analogous to the HTML <SCRIPT> element.
Example:
<?xml version="1.0"?>
<vxml version="1.0"?>
<script> <![CDATA[
function factorial(n) { return (n <= 1)? 1 : n * factorial(n-1); }
]]> </script>
<form id="form">
<field name="fact" type="number">
<prompt>Tell me a number and I'll tell you its factorial.</prompt>
<filled>
<prompt>
<value expr="fact"/> factorial is
<value expr="factorial(fact)"/>
</prompt>
</filled>
</field>
</form>
</vxml>
| Attributes |
| Name |
Value |
Description |
| src |
URI |
The URI specifying the location of the script, if it is external. |
| charset |
PCDATA |
The character encoding of the script designated by src. |
| caching |
'safe' or 'fast' |
Eithere safe to force a query to fetch the most recent copy of the content, or fast to use the cached copy of the content if it has not expired. If not specified, a value derived from the innermost caching property is used. |
| fetchint |
"prefetch", "safe", "stream" |
Defines when the interpreter context should retreive content from the server. prefetch indicates a file may be downloaded when the page is loaded, whereas safe indicates a file that should only be downloaded when actually needed. In the case of a very large file (implying long download times) or a streaming audio source, stream indicates to the interpreter context to begin processing the content as it arrives and should not wait for full retrieval of the content. If not specified, a value derived from the innermost relevant *fetchint property is used. |
| fetchtimeout |
integer |
The interval to wait for the content to be returned before throwing an error.badfetch event. If not specified, a value derived from the innermost fetchtimeout is used. |
Back to Tag Listing
|
|