Launching popup after page load

Launching popup after page load

Hello.  I am using popup features for JQM. Launching the popout via a button click is straightforward but how can I get the popup to launch after page load?

JQM docs say you can initialise the popout via:
$( "#myPopupDiv" ).popup( "open" )

I tried this by using the code below but can't get it to work. It launched on page load but would not close. I am a newbie with jquery so any help would be much appreciated. Thanks.

$(document).bind("mobileinit", function(){
$
( "#myPopupDiv" ).popup( "open" )
});