Im using the require.js text plugin (https://github.com/requirejs/text) to load my html modules from the server.
The server has an other host so a allow coss-domain-request by useing Xhr in the require.config object.
text: {
useXhr: function (url, protocol, hostname, port) {
// allow cross-domain requests
// remote server allows CORS
return true;
}
},
But when Im load some module the Browser try to interpret the loaded file as javascript file.
define([
'text!/view_templates/header.html'], function(html){
console.log(html)
})
in the broser a get:
Resource interpreted as Script but transferred with MIME type text/html: "http://app-id.appspot.com/gadget/js/app/view_templates/header.html". require.js:1843 Uncaught SyntaxError: Unexpected token < header.html:1
Did anyone have any idea where the problem is ?
Thanks for help