Prevent a popup from closing (tapping outside widget)

Prevent a popup from closing (tapping outside widget)

The problem:

I do an Ajax request. When it is finished i want to display a message in a popup window the result of the Ajax request. But i don´t want the user to accidentally close the popup by clicking outside the widget (it would be closed with a button).

So is there a way to prevent a user from closing a popup by tapping outside the widget?