user1305855
user1305855

Reputation:

onload function in jquery mobile dialog not working

Hi i'm working in jquery mobile. In which i'm triggering a dialog of another html page using

$.mobile.changePage('mypopup.html',{transition:'pop',role : 'dialog', data: {'selQty':'5'}});

and the dialog loaded succesfully.

My problem is i'm using onload function in body tag of mypopup.html

<body onload="initialize()">

which is not working. is there any problem in my code or do i need to follow alternate way. Thx in advance.

Upvotes: 1

Views: 2369

Answers (1)

Piotr Krysiak
Piotr Krysiak

Reputation: 2815

Try to add event like this:

$('#pageId').bind('pageshow', function(){

});

pageId is id attribute in your <div data-role="page" id="pageId">.

Check this page for more events: jQuery Mobile docs

Upvotes: 3

Related Questions