我有一些非常基本的 RequireJs 代码,可以使用简单的 html 获取 html 文件。在 Firefox 8.0 中它运行良好,但是在我构建的 Chrome (17.0.9.xxx) 中我收到以下错误:
仅 HTTP 支持跨源请求。
这可能只是这个版本的 Chrome 或一般的文本插件的问题吗?
define([
'jquery',
'backbone',
'text!templates/home/listOfStuff.html'
], function ($, Backbone, mainTemplate) {
var mainView = Backbone.View.extend({
el: $('#list'),
render: function () {
this.el.html(mainTemplate);
}
});
// return the view object
return new mainView;
});
当 Require 尝试获取 html 文件时,就会发生错误。