JavaScript load ordering in Razor Pages

Tinkering with a custom Notifications System inside a Razor Pages app I am working on. There is jQuery to populate a notification and show it — I’d prefer to keep that in the main Layout (in one place): function showNotification(notificationText) { cleanNotification(); if (notificationText.trim()) { $(‘#Notification’).text(notificationText); } $(‘#Notification’).addClass(‘show’); setTimeout(function () { $(‘#Notification’).removeClass(‘show’); cleanNotification; }, 3000); […]