[英]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: 一些建议:
script
tags (jquery -> handlebars -> ember) 尊重script
标签的顺序(jquery - > handlebars - > ember) body
tag, ember needs to be able to write to it 创建一个body
标签,ember需要能够写入它 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.