【问题标题】:Can I have jquery mobile working without the ui-mobile class in the html tag?我可以在没有 html 标签中的 ui-mobile 类的情况下让 jquery mobile 工作吗?
【发布时间】:2013-12-05 20:29:01
【问题描述】:

我认为将此类添加到 html 标签会导致该标签无法正常工作。

<meta http-equiv="X-UA-Compatible" content="IE=edge">

【问题讨论】:

    标签: html internet-explorer jquery-mobile compatibility


    【解决方案1】:

    正如我所说的,基本上,如果您想使用 Jquery Mobile 和 Internet Explorer“边缘”元标记,确保它能够正常工作的最佳方法是通过 PHP 发送标头并包含没有标题的html文件,可以在正文中添加样式和脚本。这是我的代码:

    <?php 
        header( 'X-UA-Compatible: IE=edge,chrome=1' ); 
    
        header( 'content: width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' );
    
        include('ix.html');
    ?>
    

    【讨论】:

      【解决方案2】:

      试试这个:&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;

      我在网上找到的一些示例表明它们将第二个元元素放在视口之后。

      <!DOCTYPE html> <html> <head> <title>Starter page</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> </head>

      http://www.appliness.com/getting-started-with-html-mobile-application-development-using-jquery-mobile-requirejs-and-backbonejs/

      http://www.1stwebdesigner.com/css/jquery-mobile-need-to-know/

      更改页面元数据:jquerymobile one page with different meta viewport settings

      【讨论】:

      • 抱歉,这不是我想要做的,你发送的这个标签有不同的作用,也许我没有正确解释自己。当 Jquery Mobile 启动时,它会将 ui-mobile 类添加到标题标记中,因此 IE 不会读取我的标题元标记。我现在要做的是先通过 php 发送标头,然后加载我的 html 页面。没有 100% 测试它,但我认为这是要走的路。谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-14
      相关资源
      最近更新 更多