I\'m trying to work with requirejs and text plugin and I have weird problem.
I have two web servers:
I've digged in the code of the text plugin.
I've found out that the text plugin assumes that the developer converted the text template to html since it resides on a different domain.
I've change the code of the text plugin to not assume it.
Someone thinks that I'm doing something wrong?
The original code of the plugin:
//Load the text. Use XHR if possible and in a browser.
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
text.get(url, function (content) {
text.finishLoad(name, parsed.strip, content, onLoad, config);
});
} else {
//Need to fetch the resource across domains. Assume
//the resource has been optimized into a JS module. Fetch
//by the module name + extension, but do not include the
//!strip part to avoid file system issues.
req([nonStripName], function (content) {
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
parsed.strip, content, onLoad, config);
});
}