You may be making a bad assumption.
document.write
has a real, practical problem, and that’s why we avoid it. But the others – prompt, confirm, and alert – are still perfectly viable, and they still get used in real-world applications today. The alert box even got a makeover in Firefox some time ago to look more modern.