Open popup from javascript loading an specific php view


I would like to know, if possible, how to open a popup under some conditions from JavaScript code loading a view defined previously in php. Concretely, when receiving an answer from a web service, I would like to activate a popup with a couple options for the user. The popup should block the background view until it is closed.