When performing long-running actions in a NetSuite Suitelet or Client Script — such as generating files, calling APIs, or triggering downloads — it’s good practice to show a loading indicator and block the UI to avoid user interaction. Here’s a reusable snippet that creates a full-screen blur overlay and centered loading GIF (spinner). Why Use… Continue reading Show a Loading Spinner with UI Blur During Long-Running Actions
Tag: loading page
Steps to Add Processing Animation Using SweetAlert2
Include SweetAlert2 Library: You can host the SweetAlert2 files in your NetSuite File Cabinet or use a CDN. function OnPageInit() { AddJavascript(‘https://cdn.jsdelivr.net/npm/sweetalert2@11’, ‘head’); AddStyle(‘https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css’, ‘head’); } function AddJavascript(jsname, pos) { var tag = document.getElementsByTagName(pos)[0]; var addScript = document.createElement(‘script’); addScript.setAttribute(‘type’, ‘text/javascript’); addScript.setAttribute(‘src’, jsname); tag.appendChild(addScript); } function AddStyle(cssLink, pos) { var tag = document.getElementsByTagName(pos)[0]; var addLink =… Continue reading Steps to Add Processing Animation Using SweetAlert2
Automatic Page Reload/Refresh in Client Scripts
Refreshing a web page without user interaction can be achieved using the window.location.reload() function in client-side JavaScript. This function reloads the current page, causing any changes made to the underlying data or UI to be reflected instantly to the user. One common scenario where this functionality is useful is in web applications that rely heavily… Continue reading Automatic Page Reload/Refresh in Client Scripts
Loading animation using Jquery
This code is to add a loading animation to the ‘Log in’ button on a website. using Jquery
Loading Image for the Background process
The script part shows is from the client script. On the Button Click action of the User Event, we are triggering this script part it will show a confirmation box. If we confirm as YES the action will take place else nothing happens. On the success, we will automatically reload that respective page.