科尔多瓦+ jquery手机+ jquery白色屏幕上的姜饼死亡

时间:2015-03-01 17:24:22

标签: android jquery cordova jquery-mobile android-2.3-gingerbread

我已经使用jquery mobile& amp;编写了一个使用cordova 4.0的应用程序jquery,当我尝试使用android 2.3.5(姜饼)在Galaxy 2上运行应用程序时,我得到的是白色屏幕,没有任何错误或任何事情发生。

注意:我从javascript捕获任何异常并提醒他们,所以如果有异常,我应该看到一条消息。但没什么。

任何想法为什么? Cordova假设在android 2.x上正常工作吗?我找到了关于这个主题的混合意见......

谢谢!

编辑:添加源代码。注意我有js包裹cordova所以在utils。*下的所有东西都是cordova的包装层。这是index.html,应该加载的第一个页面。我想说的另一件事是我添加了一个代码来捕获并警告任何异常(window.onerror = function(message,url,lineNumber)...)并提醒它们,它通常有效但在这种情况下我看不到警报。

<!DOCTYPE html>
 我们加载的部分页面不起作用。 - &GT;

    

    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
    <!-- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> -->
    <meta name="viewport" content="width=device-width, initial-scale=1">   

    <!-- My extensions to jquery-mobile css -->
    <link rel="stylesheet" type="text/css" href="css/my-jquerymobile-extend.css" />

    <!-- all basic css -->
    <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.5.min.css" />
    <link rel="stylesheet" type="text/css" href="css/msgbox.css" />
    <link rel="stylesheet" type="text/css" href="css/intro.css" />
    <link rel="stylesheet" type="text/css" href="css/splash.css" />
    <link rel="stylesheet" type="text/css" href="css/main.css" />
    <link rel="stylesheet" type="text/css" href="css/result_page.css" />
    <link rel="stylesheet" type="text/css" href="css/intlTelInput.css" />
    <title>SeekWhale</title>

    <!-- include cordova and jquery -->
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8" src="telephonenumber.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.2.1.1.min.js"></script>
    <script type="text/javascript" src="js/jquery/custom_loading_gif.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.mobile-1.4.5.min.js"></script>
    <script type="text/javascript" src="js/jquery/jquery-ui-draggable.min.js"></script>
    <script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.min.js"></script>

    <!-- Include utils -->
    <script type="text/javascript" src="js/utils/config.js"></script>
    <script type="text/javascript" src="js/utils/flags.js"></script>
    <script type="text/javascript" src="js/utils/ajax.js"></script>
    <script type="text/javascript" src="js/utils/debug.js"></script>
    <script type="text/javascript" src="js/utils/visuals.js"></script>
    <script type="text/javascript" src="js/utils/device.js"></script>
    <script type="text/javascript" src="js/utils/contacts.js"></script>
    <script type="text/javascript" src="js/utils/events.js"></script>
    <script type="text/javascript" src="js/utils/navigation.js"></script>
    <script type="text/javascript" src="js/utils/phone_numbers.js"></script>
    <script type="text/javascript" src="js/utils/prompt.js"></script>
    <script type="text/javascript" src="js/utils/forms.js"></script>

    <!-- Replace UI language with chosen language -->
    <script type="text/javascript" src="js/languages/dictionary.js"></script>
    <script type="text/javascript" src="js/languages/hebrew.js"></script>

    <!-- function to init pages -->
    <script type="text/javascript" src="js/init_page.js"></script>  

</head>

<body data-role="page">

    <img class="splash" src="img/bg-entry.png"></img>

    <script type="text/javascript">

        // set language
        ui_dictionary.set_dictionary_words();

        // called when cordova is ready to run page init script
        function InitApp()
        {
            setTimeout(function()
            {
                utils.prompt.log("app started!");
                var effect = utils.navigation.transition.slidedown;

                // if should skip directly to main
                if (utils.flags.skip_to_main)
                {
                    utils.prompt.log("skip to main page");
                    utils.navigation.load_page(utils.config.get_last_page(), effect);
                }
                // if require first setup open the first setup page:
                else if (utils.config.get_successfully_registered() == false)
                {
                    utils.prompt.log("load register");
                    utils.navigation.load_page("register.html", effect);
                }
                // if registered but not confirmed, go to confirm page
                else if (utils.config.get_is_device_confirmed() == false)
                {
                    utils.prompt.log("load confirm page");
                    utils.navigation.load_page("confirm.html", effect);
                }
                // if all goes well, open the main page!
                else
                {
                    utils.prompt.log("load main page");
                    utils.navigation.load_page("main.html", effect);
                }
            }, 1);
        }
        utils.events.on_device_ready(InitApp);

    </script>
</body>

1 个答案:

答案 0 :(得分:0)

<script type="text/javascript" src="cordova.js"></script>

这个应该是第一个要加载的js。把所有其他的js文件放在它之后。