Download JavaScript Programming Guide

Transcript
Class Reference
4.5 Functions
The following section documents functions that enhance the application development
environment.
Table of Contents
4.5.1
Dialog
The Code Reader JavaScript Engine provides the following functions like those defined by
JavaScript in Web browsers:
•
•
•
alert
confirm
prompt
These functions interact with the CR3 standard GUI display. The CR3 displays the name of the
function in the GUI status bar and the text associated with the function, and then waits until a
key is pressed. The following subsections describe the operation of each function in the CR3
environment.
Similar but more flexible functions are provided in the gui object (see section 4.1). For
example, if you want to change the caption on these displays use the gui object functions.
Table of Contents
4.5.1.1
alert
The alert function displays text in the display area of the standard GUI display. Do not call
this function within onDecode and onCommand event handlers.
Format:
alert(text);
Where:
text – string; text to display as the alert.
Processing suspends until the operator presses an enter key – either the enter key or the left
softkey defined as OK.
Example:
alert("Status Alert");
Displays the alert shown in Figure 17 and waits until the operator presses the enter key or the left
softkey (OK).
C002344_04_Code_Reader_JavaScript_Programming_Guide.doc
2/6/2008
Page 83 of 94