google-code-export / jquery-i18n-properties

Automatically exported from code.google.com/p/jquery-i18n-properties
1 stars 0 forks source link

Cross-domain requests don't work (with fix) #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When the user attempts to load a .properties file from a different domain, a 
cross-domain error is raised (because ajax cannot be used to make cross-domain 
request).

A possible solution to this problem is to switch to using JSONP when the plugin 
detects a cross-domain URL for the `path` option.

Proposed implementation can be seen here:
https://gist.github.com/todofixthis/6395194

Requires server-side support for JSONP, example here:
https://gist.github.com/todofixthis/6395205

Original issue reported on code.google.com by todofixt...@gmail.com on 30 Aug 2013 at 11:25

GoogleCodeExporter commented 9 years ago
Above gists consolidated into https://gist.github.com/todofixthis/6395194

Original comment by todofixt...@gmail.com on 3 Sep 2013 at 10:59

GoogleCodeExporter commented 9 years ago
Nevermind.  This requires a bit more work, as JSONP cannot be synchronous, and 
the plugin relies upon the Messages_*.properties requests being synchronous.

Something like an ajaxqueue would be necessary to properly support JSONP 
requests (https://gist.github.com/gnarf/1039247).

Original comment by todofixt...@gmail.com on 13 Sep 2013 at 9:03