On 26/05/10 T.J. Crowder said: > To allow this, you'd want your server to respond with these headers: > > Access-Control-Allow-Origin: * > Access-Control-Allow-Methods: GET > Access-Control-Allow-Headers: x-prototype-version,x-requested-with
So just to see if this worked, I added support for an OPTIONS request, and responded with the above. It did work in that the browser did follow up with a GET request, and my server sent the response as content-type application/json. Unfortunately it hasn't helped my situation as the transport.responseText is still empty. This is my new trace: OPTIONS /route/?start=sta-917&end=sta-10715&starttime=1274469161 HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100401 Ubuntu/9.10 (karmic) Firefox/3.5.9 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Origin: null Access-Control-Request-Method: GET Access-Control-Request-Headers: x-prototype-version,x-requested-with HTTP/1.1 200 OK Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET Access-Control-Allow-Headers: x-prototype-version,x-requested-with Content-Length: 0 GET /route/?start=sta-917&end=sta-10715&starttime=1274469161 HTTP/1.1 Host: localhost:8000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100401 Ubuntu/9.10 (karmic) Firefox/3.5.9 Accept: application/json Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive X-Requested-With: XMLHttpRequest X-Prototype-Version: 1.6.1 Origin: null HTTP/1.1 200 OK Content-Length: 76 Content-Type: application/json { "reason": "No workers ready, try again soon", "status": "defer" } Any idea why the responseText would still come back empty? Thanks, Mike -- Michael P. Soulier <msoul...@digitaltorque.ca> "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Einstein
signature.asc
Description: Digital signature