Skip to content

Instantly share code, notes, and snippets.

// guarantee fresh data on the first-loaded page (stays cached in DOM)
// see https://github.com/jquery/jquery-mobile/issues/4050
$(document).on('pagebeforechange', function(event, data) {
var $all_pages = $.mobile.pageContainer.find(':jqmData(role="page")'),
$cur_page = $.mobile.activePage,
$first_page, // unenhanced if fresh load of URL w/ hash in browser w/o pushSate support
first_page_data,
toPage_type,
root_url,
nav_urls;