Javascript Quick Reference
Javascript Quick Reference
VoiceXML uses the JavaScript language (also called ECMAScript) for manipulating data. The BeVocal VoiceXML interpreter supports
JavaScript 1.5; this version of the language supports latest the ECMA-262 Edition 3 specification. For official documentation on this
language, see http://www.mozilla.org/js/language/.
This document provides a quick reference to the JavaScript features available in BeVocal VoiceXML. It is organized as follows:
• VoiceXML Markup Characters
• Operators
• Statements
• Global Properties
• Global Functions
• Standard Objects
• BeVocal Constants (Extensions)
• BeVocal Objects (Extensions)
Operators
To see more complete example code for using JavaScript within VoiceXML, see the JavaScript samples on the VoiceXML Samples page.
Arithmetic
String
Logical
Bitwise
Assignment
Comparison
Special
Statements
Declarations
Control Flow
Comments
Global Properties
Global Functions
Standard Objects
Object
Array
Boolean
No special properties or methods.
Date
Error
Function
Math
Number
RegExp
String
None of the string methods change the original string.
bevocal.soap
bevocal.soap.SoapException
<script>
...
try {
myService.callMethod("too", "many", "parameters");
}
catch (error if error.type == "bevocal.soap.SoapException") {
if (error.cause == bevocal.soap.SoapException.CALL_ERROR) {
// Probably passed the wrong number of arguments
}
}
</script>
bevocal.soap.SoapFault
Property/Method Description
type bevocal.soap.SoapFault.
faultString A message describing the reason for the exception.
faultCode A code describing the reason for the failure.
faultActor The serviceId passed to lookupService could not be found in the registry.
detailString A String representation of the detail element of the fault. The detail element is present whenever a fault is
caused by processing of the Body element.
details An object whose properties are the detail elements; that is, the immediate child elements of the detail element
in the fault element.
MUST_UNDERSTAND SOAP fault code: A child of the SOAP Header element that contained a mustUnderstand attribute equal to "1"
was not understood.
VERSION_MISMATCH SOAP fault code: The processor found an invalid namespace for the SOAP Envelope.
SERVER SOAP fault code: Processing of the call failed due to an error on the server. The failure was not directly related to
the contents of the message, and the message may succeed at a later point in time.
CLIENT SOAP fault code: Processing of the call failed due to the contents of the message. This failure code is returned
when a function is called with invalid parameters, bad data, and so on.
bevocal.soap.SoapFaultDetails
Property/Method Description
type bevocal.soap.FaultDetails
(String) String representation of the details elements.
Property/Method Description
(Number) Number of detail elements represented by the FaultDetail object.
element id Given a property name that is the local name (without namespace) of one of the child elements of the details
element, the property value is the text contents of the child element.