jQuery Mobile,加载表单提交页面时出现问题 [英] JQuery Mobile, problem with loading form submitted pages

查看:48
本文介绍了jQuery Mobile,加载表单提交页面时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究我们网站的移动视图.我正在尝试实现JQuery mobile,但遇到两个问题可能会阻止我继续前进,并希望你们中的一些人有见识.

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.

许多页面都是通过搜索显示的.但是,当从搜索框中打开页面时,我无法将其作为rel ='external'加载,因此该页面是通过Ajax加载的.很好,除了要加载的页面几乎都是较大的页面,它们分成了data-role ='page'.因此,当页面加载时,尽管它确实隐藏了次要部分,但无法在该页面内导航.根据文档,我需要将rel ="external"放在表单上,​​但这对我不起作用.是否可以通过表单提交来在没有Ajax的情况下加载页面?

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?

同一主题中的第二个问题.在爬,走,跑时尚的第一步是基本的移动友好网站.但是,我希望这也可以成为基于PhoneGap的网站版本的基础.据我了解,如果页面不总是在Ajax中加载,则PhoneGap的基本模型将中断,因为它将触发浏览器加载.由于JQM需要通过rel = external加载任何嵌入有data-role = page节的页面,这会关闭Ajax加载,这是否意味着使用JQM会阻止稍后使用Phone Gap创建本机客户端?

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 using Phone Gap to create the native client later?

在此先感谢您的答复.

推荐答案

下面的脚本应该放在您的jquery min和jquery mobile min之间.否则将不会生效.在关闭了这些ajax功能的情况下,向$ .mobile添加扩展名可能会帮助您解决问题.不需要全部三个,但是它们都值得您考验.

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用于构建电话应用程序,而不用于移动网站.它是由Javascript组成的,它与特定的库进行对话以与移动设备本身进行交互.

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.

这篇关于jQuery Mobile,加载表单提交页面时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆