prompt function. I find it very useful but I was curious as to why the decline of usage. I see something very similar to it used everyday ( iOS password prompts ) and I'm wondering why it's not used more often on the web? Is it just not customizable enough for designers? Do users not prefer these cause it's hard to tell what page it originated from ( in some browsers )?
There are many reasons to avoid the
prompt box. There's a good list in this programmers.se answer but here are the reasons it's not helpful:
It's not customizable, full stop. You get to word your prompt and you can't even specify the wording to use for "okay" or "cancel," regardless of whether the prompt is for "Send Email" or "Kill my family". It's also impossible to style visually, while things like Jquery UI give you richer functionality while being fully customizable as well.
They're annoying, and they are always modal. With Jquery and other libraries you can make windows that aren't modal or windows that disappear when you click outside them.
When all prompts look the same and all prompts have the same options, you're training people to click okay (if that's the one that lets you continue); the okay button loses it's impact and just becomes the "shut up and let me finish this form" button.
There's some other more technical reasons, but that should be more than enough reason to never use them.
When I have my developer hat on, I used to use them quite a bit since they were incredibly easy to implement.
When I have my UX/UI hat on, I can appreciate the fact that they are quite limited in terms of visual presentation.
That said, we're now using them quite a bit more again in our mobile web sites. The advantage on them mobile side is that the JS alerts and confirm boxes are much more native to the device, so offer a sense of familiarity for the user. That and roll-your-own modals, while certainly doable, aren't necessarily a good UI element on a lot of mobile devices.