jQuery-mobile and ASP.NET combination issue

后端 未结 2 1409
庸人自扰
庸人自扰 2021-01-14 13:10

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

相关标签:
2条回答
  • 2021-01-14 13:32

    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:

    <script src="http://www.dragan-gaic.info/js/jquery-1.8.2.min.js"></script>      
    <script>
            $(document).bind("mobileinit", function () {
                $.mobile.ajaxEnabled = false;
            });    
    </script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>  
    
    0 讨论(0)
  • 2021-01-14 13:44

    I DID IT.....

    DO NOT USE instructions described here

    simply open jquery.mobile-1.3.1.min.js file fine ajaxEnabled:!0 and change it to : ajaxEnabled:!1

    now hit CTRL+F5 and joy the project while it continues ! ;)

    0 讨论(0)
提交回复
热议问题