简体   繁体   English

未捕获的TypeError:对象原型可能只是一个Object,或者在ember.js上为null

[英]Uncaught TypeError: Object prototype may only be an Object or null on ember.js

I'm trying to get started with ember.js, so I've followed the tutorials as closely as I can. 我正在尝试使用ember.js,所以我尽可能地遵循教程。 I currently have this HTML: 我目前有这个HTML:

<!doctype html>
<html>
 <head>
  <script type="text/x-handlebars" data-template-name="application">
   Test
 </script>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
   <script src="ember-1.0.0-rc.1.min.js"></script>
   <script src="handlebars.runtime.js"></script>
   <script src="app.js"></script>
 </head>

</html>

Where app.js is: app.js的位置是:

App = Em.Application.create();

and in Chrome I am getting: 在Chrome中我得到:

Uncaught TypeError: Object prototype may only be an Object or null ember-1.0.0-rc.1.min.js:18

Where am I going wrong? 我哪里错了?

Thanks! 谢谢!

Some suggestions: 一些建议:

  • follow my instructions here: Ember.js missing modules? 按照我的指示: Ember.js缺少模块?
  • respect the order of the script tags (jquery -> handlebars -> ember) 尊重script标签的顺序(jquery - > handlebars - > ember)
  • create a body tag, ember needs to be able to write to it 创建一个body标签,ember需要能够写入它
  • put the script tags right before the </body> tag script标记放在</body>标记之前

Resulting in: 导致:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>bitshiftcop.com</title>
  </head>
  <body>
    <script type="text/x-handlebars" data-template-name="application">
      Test
    </script>    

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="handlebars-1.0.0-rc.3.js"></script>
    <script src="ember-1.0.0-rc.1.js"></script>
    <script src="app.js"></script>
  </body>
</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的TypeError:对象原型可能只是一个Object,或者在ember-1.0.0-pre.2上为null - Uncaught TypeError: Object prototype may only be an Object or null on ember-1.0.0-pre.2 未捕获的TypeError:Symfony 2中的ExtJS对象原型只能是Object或为null - Uncaught TypeError: Object prototype may only be an Object or null with ExtJS in Symfony 2 未捕获的类型错误:Object 原型可能只是 Object 或 null:未定义 - Uncaught TypeError: Object prototype may only be an Object or null: undefined 未捕获的TypeError:对象# <Object> 没有方法“重新打开”(Ember.js) - Uncaught TypeError: Object #<Object> has no method 'reopen' (Ember.js) Extjs Sencha编译的应用程序引发Uncaught TypeError:对象原型只能是Object或null - Extjs sencha compiled app throws Uncaught TypeError: Object prototype may only be an Object or null TypeError: Object prototype may only be an Object or null: undefined - TypeError: Object prototype may only be an Object or null: undefined 运行dyson模拟服务器(使用express.js)的异常“ TypeError:对象原型只能是对象或为空” - Exception 'TypeError: Object prototype may only be an Object or null' running dyson mock server (using express.js) Node.JS对象原型可能只是一个Object,或者使用Redis为null - Node.JS object prototype may only be an Object or null with Redis Ember.js把手BoundHelper未捕获TypeError:对象# <Object> 没有方法“拆分” - Ember.js Handlebars BoundHelper Uncaught TypeError: Object #<Object> has no method 'split' ember.js未捕获的TypeError:对象数据大小没有方法&#39;transitionTo&#39; - ember.js Uncaught TypeError: Object data-size has no method 'transitionTo'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM