I am developing a mobile solution with a combination of jQuery.mobile and asp.net webforms.
For postbacks of my asp.net controls to work properly I have to disable
Document ready can not be successfully used with jQuery Mobile
. It will usually trigger before page DOM
is populated.
Instead of this line:
$(document).ready(function () {
$('#myPopup').popup('open');
});
Use this line:
$(document).on('pagebeforeshow', '#page-id', function(){
$('#myPopup').popup('open');
});
Where #page-id
is an id of page that contains that popup.
jQuery Mobile has a problem with document ready so its developers have created page evenets to remedy this problem, read more about it in this ARTICLE or find it HERE.
EDIT :
I think your problem is also in $.mobile.ajaxEnabled = false;
handling.
That code sample MUST be triggered from mobileinit
event like this:
$(document).bind("mobileinit", function () {
$.mobile.ajaxEnabled = false;
});
One more thing, mobileinit
event MUST be triggered before jQuery Mobile
is initialized, like this: