COME HERE $( document ).on( "pageinit", function() { $( "#externalpage" ).on({ popupbeforeposition: function( event, ui ) { console.log( event.target ); } }); });