Watir Read javascript popups contents

am looking to evaluate the contents of a javascript popup using watir,

i have googled around heavily and found some code that people suggest
would work but nothing i have tried so far works, the only thing i have
found myself capable of doing is clicking the buttons. i dont want to
click the buttons i wish to read the contents to evalutate its contents
before closing it

can anyone suggest a good method for reading the contents or alerts or
popups

im sure there has to be methods of doing this, if not through watir
maybe another ruby module that interfaces IE through com in the same
way, since evaluation could be done anyway suggested and then i can
close the popup using watir so i can continue onwards