DokuMe provides some helper tools for easier coding. This functions are only available within DokuMe environment.

Get Dom element

Use this shorthand functions to write less code. Also it catches any errors if an element is undefiened.

el('elementId') == document.getElementById('elementId')

elq('querySelector') == document.querySelector('querySelector')

Error handling

Use this function to validate your API requests, whether there are no errors. If so they will be catched and an error notification will be displayed to the user.

util.errorHandler(data, showSuccess, callback)


if (!util.errorHandler(data)) {
    return false;
param type value
data JSON Object should contain { data.SUCCESS === true }
showSuccess INT null, 1 = Show save success message, 0 = Show delete success message
callback FUNCTION

System notifications

DM_TEMPLATE.showSystemNotification(type, text, callback);
param type value
type INT 1 = Success, 0 = Error
text TEXT The text as a string that should be displayed
callback FUNCTION