2020.2

Table Of Contents
<img id="camera" src="" width="100%">
4.
Switch back to the Design tab. You will see a small, empty rectangle inside at the top of
the inline box.
5.
Right-click the empty rectangle and choose New Script... in the contextual menu. The
Edit Script dialog appears. The selector of the script is automatically set to the ID of the
selected element (#camera).
Alternatively, you could add a new script on the Scripts pane and make sure that the
Selector field is set to #camera.
6. Enter the following script code:
results.attr("src", record.fields.photo);
The name of the data field (in this case: photo) must be that of the Camera data in your
data model.
This script updates the attribute “src” with the field containing the base64 image.
7.
Click OK to save the script and toggle to the Preview mode to see the result. You should
see your image. When you resize the inline box that surrounds the image, the image
should be resized as well.
If the inline box isn't visible, click the Show Edges button in the toolbar.
Capture OnTheGo API
As of Connect 1.8, cotg-2.0.0.js has replaced the cotg-1.x.js versions of the Capture OnTheGo
(COTG) plugin, introducing events and options for COTG widgets. This topic lists all available
options and custom events for widgets, as well as their initialization function.
How to use the COTG plugin is explained in the following topic: "Using the COTG plugin: cotg-
2.0.0.js" on page587.
To learn how to create widgets in code, see "Dynamically adding COTG widgets" on page589
and "Saving and restoring custom data and widgets" on page593.
For a list of all COTG elements and their intended use, see "COTG Elements" on page689.
Barcode Scanner
cotgBarcode()
Initializing a Barcode Scanner element prepares it for user interaction.
Example: $('myScanner').cotgBarcode();
Page 600