mirror of
https://github.com/Floriansylvain/Exo-technique-VIE-Barcelone-SaaS-HRTech.git
synced 2026-08-19 11:43:23 +02:00
20 lines
739 B
JavaScript
20 lines
739 B
JavaScript
export function renderError(container, message) {
|
|
if (!container) return;
|
|
try {
|
|
const $c = (container.jquery) ? container : (typeof container === 'string' ? $(container) : $(container));
|
|
$c.html(`<div class="error-message">${String(message)}</div>`);
|
|
} catch (e) {
|
|
if (container instanceof Element) container.innerHTML = `<div class="error-message">${String(message)}</div>`;
|
|
}
|
|
}
|
|
|
|
export function insertHtml(container, html) {
|
|
if (!container) return;
|
|
try {
|
|
const $c = (container.jquery) ? container : (typeof container === 'string' ? $(container) : $(container));
|
|
$c.html(html);
|
|
} catch (e) {
|
|
if (container instanceof Element) container.innerHTML = html;
|
|
}
|
|
}
|