3

Possible Duplicate:
jQuery - How to remove cross domain limitation

I'm currently developing a single-page-application based on Backbone.js. I'm also having a remote RESTful-Service which answeres with JSON-Results (this service can't be changed..).

Obviously the problem is that I'm not able to consume the rest-service in my SPA because it does not support JSONP.

The question that I'm having is: Does this mean that there is no way that my SPA can use the restful service unless it changes its answere-format to JSONP?? Or is there some kind of workaround that I did not find yet.

Thank you

EDIT: I found a very interesting post that covers my questions.

jQuery - How to remove cross domain limitation

Community
  • 1
  • 1
user1727072
  • 309
  • 4
  • 14
  • Do you mean to say the single-page application is hosted on a different server than your REST service? – McGarnagle Oct 07 '12 at 17:52
  • You could proxy the REST service through your own server. – mu is too short Oct 07 '12 at 18:18
  • yes the spa is hostet on a different server. I actually don't want to proxy the service because that would cause a lack of performance.. – user1727072 Oct 07 '12 at 20:46
  • 2
    @user1727072 are you sure it would cause a lack of performance? I've written several apps that use third party data services proxied through my own backend, and they've never had noticeable issues with latency due to this... – tkone Oct 08 '12 at 15:01
  • +1 on using proxy. Please see my response to a related(kind of IE-specific) question, but it solves a similar issue: http://stackoverflow.com/questions/10035812/how-to-make-an-ajax-request-to-an-api-using-cors-and-backbonejs/10038912#10038912 – Karthik Oct 11 '12 at 18:55

0 Answers0