How can I create a custom alert function in Javascript?
+5
A:
You can override the existing alert function, which exists on the window object:
window.alert = function (message) {
// Do something with message
};
Matt
2010-08-02 21:22:33
+3
A:
If you're looking for a javascript/html/css replacement, I recommend checking out jQueryUI and its implementation of modal dialogs.
advait
2010-08-02 21:29:14
+2
A:
Technically you can change what the alert function does. But, you cannot change the title or other behavior of the modal window launched by the native alert function (besides the text/content).
CD Sanchez
2010-08-02 21:34:54
Alright, that's what I needed to know. +1. But accepted advait's answer because he gave me an alternate solution.
Elliot Bonneville
2010-08-02 21:39:09