We recommend using SweetAlerts for this. This is what you'll see on the core portal pages when things are loading or saving:
The SweetAlert library is already loaded by default in the portal, all you have to do is follow their docs for use in your portal page JS.