Expense Management
Get high quality finance and business content in your inbox


const currentHead = document.head; preloadLinks.forEach(({ href, as }) => { const link = document.createElement('link'); const resourceDomain = new URL(href).hostname; link.rel = 'preload'; link.href = href; link.as = as; // Set crossOrigin attribute if the domain is different from 'aspireapp.com' if (!resourceDomain.endsWith('aspireapp.com')) { link.crossOrigin = 'anonymous'; } currentHead.appendChild(link); }); } catch (error) { console.error('Error while adding preload links:', error); } }; // Delay execution by 3 second setTimeout(() => { if ('requestIdleCallback' in window) { requestIdleCallback(execute); } else { execute(); } }, 3000); }());