Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery mobile EmberJS和Jquery Mobile提供空白灰色页面_Jquery Mobile_Ember.js - Fatal编程技术网

Jquery mobile EmberJS和Jquery Mobile提供空白灰色页面

Jquery mobile EmberJS和Jquery Mobile提供空白灰色页面,jquery-mobile,ember.js,Jquery Mobile,Ember.js,我正在尝试用JQuery mobile和EmberJS构建一个小型移动应用程序。 这实际上是一个Rhodes应用程序(Rhomobile) 这是我的布局。erb: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Todo</title> <!-- Ember Libraries --> <script

我正在尝试用JQuery mobile和EmberJS构建一个小型移动应用程序。 这实际上是一个Rhodes应用程序(Rhomobile)

这是我的布局。erb:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Todo</title>


        <!-- Ember Libraries -->        
        <script src="/public/js/libs/handlebars-1.0.0.js"></script>
        <script src="/public/js/libs/ember.js"></script>
        <script src="/public/js/libs/ember-data.js"></script>

        <!-- Ember Application -->
        <script src="/public/js/application.js"></script>
        <script src="/public/js/router.js"></script>
        <script src="/public/js/models/todo.js"></script>
        <script src="/public/js/controllers/todos_controller.js"></script>




        <script type="text/javascript">
            $(document).bind("mobileinit", function(){    
                $.mobile.loadingMessage = false;
                $.mobile.loadingMessageDelay = 300; // in ms
                $.mobile.defaultPageTransition = 'none';
                $.mobile.defaultDialogTransition = 'none';
                $.mobile.ajaxEnabled = false;
                $.mobile.pushStateEnabled = false;
                $.mobile.loadingMessageDelay = 50; // in ms
            });
        </script>
        <link rel="stylesheet" href="/public/jqmobile/jquery.mobile-1.3.1.min.css">
        <link rel="stylesheet" href="/public/css/jqmobile-patch.css">
        <script src="/public/jqmobile/jquery.mobile-1.3.1.min.js"></script>
        <script src="/public/js/jqmobile-patch.js"></script>

</head>

<body data-platform="<%= Rho::System.getProperty('platform') %>">
    <%= @content %>
</body>

</html>

待办事项
$(document).bind(“mobileinit”,function(){
$.mobile.loadingMessage=false;
$.mobile.loadingMessageDelay=300;//以毫秒为单位
$.mobile.defaultPageTransition='none';
$.mobile.defaultDialogTransition='none';
$.mobile.ajaxEnabled=false;
$.mobile.pushStateEnabled=false;
$.mobile.loadingMessageDelay=50;//以毫秒为单位
});
正如你所看到的,我已经禁用了Ajax和PushState之类的东西。这是我的index.erb:

  <script type="text/x-handlebars" data-template-name="todos">
    <div data-role="page">
        //My Template
      </div>
  </script>

//我的模板
现在当我尝试时,我只得到一个空白的灰色页面。但控制台或Ember控制台(Chrome的扩展)中没有错误。它甚至可以正确地检测我的视图和控制器

然后我试着对jQueryMobileCSS文件进行注释,我得到的是一个页面的高度,相当于带有“Loading”消息的空白空间,然后我在下面看到我的应用程序,它工作正常。如果我删除jQueryMobileJS,我会得到这些东西,但它没有样式


有什么问题吗?

如果没有看到更多的应用程序代码,很难说。如果只定义了一个模板(
'todos'
),则可能是Ember不知道如何启动应用程序的呈现。您可能需要定义一个
“应用程序”
模板。这可能很简单:

<script type="text/x-handlebars" data-template-name="application">
  {{outlet}}
</script>

{{outlet}}

是的,我只有一个模板。这可能是问题所在吗?为什么todos mvc应用程序没有这个模板?很难说没有看到任何代码。你能发布一个JSBin吗?可能是