我刚开始来看看Ember.js时遇到与包含模板属性车把模板的问题:Ember.js/Handlebars.js错误解析在车把模板属性名
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />
<script type="text/javascript" src="js/handlebars-1.0.0.beta.6.js" />
<script type="text/javascript" src="js/ember-1.0.pre.js" />
<script type="text/x-handlebars" data-template-name="say-hello">
<p>First name: {{name.firstName}}</p>
<p>Last name: {{name.lastName}}</p>
<p>Last full: {{name.fullName}}</p>
<a href="#" {{action "edit" on="click"}}>Edit</a>
</script>
</head>
<body>
<h2>Hello World!</h2>
</body>
</html>
我在Chrome中得到一个错误:
This page contains the following errors:
error on line 14 at column 10: error parsing attribute name
Below is a rendering of the page up to the first error.
我也是在Firefox得到一个错误。
我想这是浏览器试图验证文件,有没有什么办法可以避免这种情况,仍然保持文档类型?
嘿,我也是新来的。我认为这个错误与doctype没有任何关系。你在“say-hello”模板中有什么代码? – Aras