hardcoded absolute URL for resource
xliyong opened this issue · 4 comments
xliyong commented
In Phonegap environment, where file// protocol is used to retrieve resource files, the absolute url does not work
var url = '/i18n/resources-locale_' + localize.language + '.js';
lavinjj commented
What do you think if we require a constant that would provide an absolute URL? Then it would work in all environments.
xliyong commented
Right now, I simply remove the leading slash and use relative path to retrieve the resource file. This may not work in other environments.
You could try loading the resource file based on document base href attribute. The base href attribute is usually set to the application starting page, which applies for both web applications and phonegap applications.
lavinjj commented
Sounds good enough for me.
lavinjj commented
It's been changed. should now work for you without modification.