开发者

JQuery Mobile, problem with loading form submitted pages

开发者 https://www.devze.com 2023-03-12 06:20 出处:网络
I\'m working on a mobile view of our site. I\'m trying to implement JQuery mobile but I\'m seeing two issues that might prevent me from continuing and hoping some of you have insights.

I'm working on a mobile view of our site. I'm trying to implement JQuery mobile but I'm seeing two issues that might prevent me from continuing and hoping some of you have insights.

Many pages are brought up by searches. But when the page is brought up from a search box I can't get it to load as rel='external', thus the page loads via Ajax. Great, except the pages that load are almost always larger pages broken up into data-role='page'. So when the page loads it's unable to navigate within that page, though it does hide the secondary sections. According to the documentation I need to put the rel="external" on the form, but that is not working for me. Is it possible to get the page to load without Ajax via a form submit?

Second question in same topic. In the crawl, walk, run fashion first step is a basic mobile friendly site. But I'm hoping this can also be the foundation for a PhoneGap based version of the site. From what I understand the basic model for PhoneGap will break if pages are not always loaded in Ajax as it will trigger a browser load. Since JQM requires any page with embeded data-role=page sections to be loaded via rel=external, which turns off Ajax loading, does this mean using JQM will preclude usin开发者_如何学编程g Phone Gap to create the native client later?

Thanks in advance for any replies.


This script below should be put between your jquery min and your jquery mobile min. Otherwise it will not take effect. Adding an extension to the $.mobile with these ajax functionalities turned off may help your issue. All 3 are not needed, but they are all test worthy for your issue.

 <script>
    $(document).bind('mobileinit',function(){

        $.extend(  $.mobile , {
                    ajaxFormsEnabled: false,
            ajaxLinksEnabled: false,
            ajaxEnabled: false

        });
    });

</script>

Phonegap is for building phone applications, not mobile websites. It is composed Javascript which talks to specific libraries to interface with the mobile device itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号