My aspx page:-
As far as I know, what you want to do, can't be done. So, what exactly can we do?
I think the simpliest think would be to move showMessage outside of the ready function, and just call it from within.
Now, if it really must be defined within that function, make it a named function:
function calledonready()
{
/// stuff
function showMessage(){
/// stuff
}
}
$(document).ready(calledonready);
window.opener.document.calledonready.showMessage();