load javascript when div opening

load javascript when div opening

Hi experts,

Hi use this example for my phonegap application: http://wiki.phonegap.com/w/page/36868306/UI-Development-using-jQueryMobile

When I click on the button Recent Alternatives it will open the content of <div data-role="page" id="recent">.
How can I load a javascript function when this page opened, like div data-role="page" id="recent" onload="test()">. Unfortunately, this isn't working. Anyone have ideas?