简体   繁体   中英

How to make alert-like synchronized alert/confirm dialog

I am building a confirmation dialog to remind user that the current token is getting expired very soon, once the they hit "confirm" then I will make an post call to refresh the token, if they don't hit confirm, then the token will not be refreshed.

I used alert / confirm dialog by default in JS now. However, I found the alert / confirm dialog is for entire browser which is a little bit annoying, I am looking for a way to show dialog for the application tab only. Meaning, default alert function in JS actually shows the dialog regardless the tab you are at now.

Can anyone tell me the basic idea how to implement this?

I would look into the .dialog() method in jQuery. You can create buttons for that dialog and have the buttons do what you want without blocking the entire browser. https://jqueryui.com/dialog/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM