$(document).bind("pagebeforeload",function(e, d){ if(d.dataUrl == "/example.html"){ e.preventDefault(); //別の場所からデータを自力で取得 if(result == true){ d.deferred.resolve(d.absUrl, d.options, $page) } else{ d.deferred.reject(d.absUrl, d.options); } } });
$(document).bind("pageload",function(e, d){ //ロードが成功した時の処理 });
$(document).bind("pageloadfailed",function(e, d){ ErrorLog("ページ読み込み失敗\n" + "リクエスト先URL:" + d.absUrl + "\n" + "リクエスト元URL:" + d.this.URL); });
$(document).bind("pagebeforechange",function(e, d){ if(typeof d.toPage == "string"){ if(d.toPage == "http://example.com/redirect-to-hoge.html"){ d.toPage = "http://example.com/hoge.html"; } } });
$(document).bind("pagechange",function(e, d){ //ページ変更後の処理 });
$(document).bind("pagechangefailed",function(e, d){ //ページ変更失敗後の処理 });
$(document).bind("pagebeforeshow",function(e, d){ //ページ表示前の処理 });
$(document).bind("pageshow",function(e, d){ //ページ表示後の処理 });
$(document).bind("pagebeforehide",function(e, d){ //ページ非表示前の処理 });
$(document).bind("pagehide",function(e, d){ //ページ非表示後の処理 });
$(document).bind("pagebeforecreate",function(e){ //全ページ共通の処理 }); $("#page-about").live("pagebeforecreate",function(e){ //aboutページ特有の処理 });
$(document).bind("pagecreate",function(e){ //全ページ共通の処理 }); $("#page-about").live("pagecreate",function(e){ //aboutページ特有の処理 });
$(document).bind("pageinit",function(e){ //全ページ共通の処理 }); $("#page-about").live("pageinit",function(e){ //aboutページ特有の処理 });
$(document).bind("pagemove",function(e){ //全ページ共通の処理 }); $("#page-about").live("pagemove",function(e){ //aboutページ特有の処理 });