How To Display An Exception In Js Alert()?

How to display a CHttpException arisen (by a throw in my controller) when submitting a form in alert() on the same page as the form, not in a newly loaded page?