我对 Web 应用程序框架的整个概念非常陌生,昨晚我从 ember.js 开始。我已经按照他们的入门视频教程进行操作,但我遇到了这个问题。
Ember.js 正在尝试发出 GET 请求来访问一些非常奇怪的文件。这是我的文件和错误。除了 ember 发出请求并收到禁止的 403 错误(由于 apache 阻止它具有不正确的字符)之外,该代码完美地工作
<!-- An extract of my index.html -->
<script type="text/x-handlebars" id="shots">
{{#each}}
<h4>{{title}}</h4>
<h6>Shot ID: {{id}}</h6>
<hr />
<p>Published on the {{pubDate}} by {{author.name}}</p>
<img src="{{image}}" alt="{{description}}" />
<p>{{description}}</p>
{{/each}}
</script>
然后这是我的 JavaScript:
// core.js
Master = Ember.Application.create();
Master.Router.map(function() {
this.resource('home');
this.resource('shots');
});
Master.ShotsRoute = Ember.Route.extend({
model: function() {
return shots;
}
});
var shots = [{
id: '1',
title: "It Works!",
author: { name: "Luke Shiels", user: "0001"},
image: "assets/img/0001.png",
pubDate: new Date('26-11-2000'),
description: "A new shot, lol!"
}, {
id: '2',
title: "It also Works!",
author: { name: "Luke Shiels", user: "0001"},
image: "assets/img/0001.png",
pubDate: new Date('27-11-2000'),
description: "Another shot, lol!"
}];
我收到以下“错误”:(
http://i.imgur.com/fRLkaFQ.png
抱歉,没有足够的代表来发布图片)