I want to make a cross-domain request with ajax to get non-JSON(!) data (CSV-File). I'm using following code:
$.ajax({ "url": dataset.url, "dataType": "text", "crossDomain": true }).done(function(data) { });
But it is not working because of the cross-domain restriction. When i set the datatype to "jsonp", it's also not working because the data will be interpreted and i get syntax errors.
Are there any workarounds? Thanks.
asked Jan 4, 2013 at 15:10
1 Answer 1
You have following options:
- Use server side proxy
- JSONP, wrap csv into jsonp response
- Use CORS (check cross browser support)
answered Jan 4, 2013 at 15:20
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-js
$.ajax
unless you extend it) because IE uses a different xhr object for CORS requests. Best would be to just make the request from your server.