What's the best way to write my own confirm in js?

后端 未结 1 1836
小鲜肉
小鲜肉 2020-12-21 14:53

I want to skin my own confirmation dialog using bootstrap modal without having to hook up events and without resorting to any library, except angular or jquery.

Basi

1条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 15:36

    Your best bet for a blocking function is the old window.showModalDialog method (which has excellent IE support, btw). But you should not use it.

    Make it event-based. Especially when for learning purposes. You won't get the bootstrap modal without events. If you want a nicer abstraction, return a Promise from your function.

    0 讨论(0)
提交回复
热议问题