RequireJs text plugin provides Cross origin error in Chrome

I have very simple RequireJs code that extracts an html file with simple html. It works fine in Firefox 8.0, however in my version of Chrome (17.0.9.xxx) I get the following error:

Cross-start requests are only supported for HTTP.

Maybe this is just a problem with this build of Chrome or a text plugin in general?

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;

});

When trying to retrieve an html file, an error occurs.

+5
source share
2 answers

I agree with ProTom there, if you set up a web server to serve your html pages, you should be set up.

+5
source

chrome. :

- allow-file-access-from-files --disable-web-security

+9

All Articles