6

I am developing a Backbone app which heavily relies on a REST API using ajax/fetch calls.

All my business logic is written in PHP classes using MySQL. For now i am utilizing FRAPI as the API which works very well for me.

In my development environment I have two virtual hosts:

  1. a static HTML/JS client app -> localhost
  2. FRAPI API in PHP -> api.local

The problem is that my clients requests are crossdomain (IE and such browser don´t work).

What can I do to keep my client vhost static (no PHP proxy) and not using JSONP? What RESTful API is typically used for Backbone?

Riebel
  • 789
  • 2
  • 10
  • 22
  • 1
    JSONP is only for GET requests... CORS is probably the simplest way to achieve cross domain POST and GET calls : see http://stackoverflow.com/q/7174902/447074 – Tricote Nov 26 '11 at 18:07

1 Answers1

0

take a look here, on how you can achieve cross domain calls...

backbone.js and cross domain scripting

i fear however you will need option 2, presented in the above url...

Community
  • 1
  • 1
Sander
  • 13,301
  • 15
  • 72
  • 97