Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

This function creates a new JS Resource in Miva's JS Resource Management.


Description#

This function creates a new JS Resource in Miva’s JS Resource Management.

Request Body Parameters#

Parameter Type Required Description
JavaScriptResource_Code String Yes Required. Code of the new resource. Must be unique.
JavaScriptResource_Type String Yes Required. Resource type. One of C (combined), I (inline script), L (local file), E (external file), M (module) or Y (module inline).
JavaScriptResource_File_Path String No File path or URL of the script (max 254 characters). Required when the type is L or E.
JavaScriptResource_Global Boolean No Whether the resource is global.
JavaScriptResource_Active Boolean No Whether the resource is active.
JavaScriptResource_Module_Code String Yes Code of the module that provides the resource. Required when the type is M or Y. The module must be active and support the jsresource feature.
JavaScriptResource_Module_Data String Yes Module data for the resource (max 100 characters). Required when the type is M or Y.
JavaScriptResource_Attributes Array Attributes for the script tag. Each element has a required name and an optional value.

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "JavaScriptResource_Insert",
    "JavaScriptResource_Code": "test",
    "JavaScriptResource_Type": "l",
    "JavaScriptResource_File_Path": "themes/00000001/shadows/custom.js",
    "JavaScriptResource_Global": true,
    "JavaScriptResource_Active": true
}

Example Response#

{
    "success": 1
}