Set Image Data

Table of Contents

Overview

This JS API task allows you to embed an image (URL) to an HTML <image> tag. The image can either be a public URL or be retrieved from the value of a Creator field.

Request Details

Syntax

ZOHO.CREATOR.UTIL.setImageData(imageTag, imageURL, callbackFunction);

The syntax includes:

NameTypeDescription
imageTagHTML elementThe HTML element where the image needs to be displayed.
imageURLstringThe image's source URL. If the image needs to be retrieved from a Creator field, use the download URL that saves the image from a record.
callbackFunction
(Optional)
functionCode to perform further executions with the response.

Possible Errors

Refer to this page for the complete list of error codes and messages.

Sample Input

Copiedvar imageTag = document.getElementById("imgtag");
var imageURL = "/api/v2/zylker/Contacts/view/All_Contacts/66359000000015039/Upload/download";
ZOHO.CREATOR.UTIL.setImageData(imageTag, imageURL, callbackFunction);