$(document).on({
"pageinit": function () {
alert("pageinit");
//$("#popupBasic").popup('open'); will throw error here because the page is not ready yet
//simulate ajax call here
//data recieved from ajax - might be an array, anything
var a = Math.random();
//use this to transfer data betwene events
$(this).data("fromAjax", a);
},
//open popup here
"pageshow": function () {
alert("pageshow");
//using stored data in popup
$("#popupBasic p").html("Random : " + $(this).data("fromAjax"));
//open popup
$("#popupBasic").popup('open');
}
}, "#page1");
And here's a demo : http://jsfiddle.net/hungerpain/MvwBU/
http://stackoverflow.com/questions/17559883/jquery-mobile-popup-is-not-opening-on-popupopen
'모바일웹 > Jquery Mobile' 카테고리의 다른 글
alert대신 jquery mobile의 dialogue를 사용하기 (0) | 2015.03.18 |
---|---|
alert대신 jquery mobile의 dialogue를 사용하기 (0) | 2015.03.09 |