Charlie
Charlie

Reputation: 11767

Change JS alerts to show/hide jQuery alert div?

The title is confusing, so I'll elaborate..

I am working on a FaceBook box for my website, and when the comment is successfully posted, it displays an alert(). I am wanting to get rid of the alert() and instead, via jQuery, show and then fade out a div which will say the same thing as the alert() box.

Here's my code:

}, function (response) {
    if (response == 0) {
    alert("Your FaceBook status has not been updated.");
    } else {
        alert("Your FaceBook status has been updated.");
    }
    showLoader(false);
});

Upvotes: 1

Views: 2250

Answers (2)

simshaun
simshaun

Reputation: 21466

While you can replace the native alert() functionality, you can not achieve the blocking effect that the browser's native alert() provides.

I suggest something like this, or take a look at this SO question.

Upvotes: 2

Related Questions