Convert Drupal error message to JavaScript alert How I am able to do that?

I'd like to show the status/error messages in form of an alert using JavaScript instead of showing it on the screen.
It think the better messages module is for you.