Does jQuery's $.ajax call support only transfer of json or script data types, when request is cross-domain?
-
I can see the data downloaded in my chrome console if the url is not json such as home page of .But it's not accessible in the success function.But if the url parameter is something that has json data as it's body, it is accessible through returnXHR.responseText.
-
Answer:
By default, $.ajax can only use script or JSON dataTypes for cross-origin resources. The origin domain must be configured to allow CORS requests for any other HTTP request types (get/post/put/delete etc.) See also: https://developer.mozilla.org/En/HTTP_access_control http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
Rick Waldron at Quora Visit the source
Related Q & A:
- What is the simplest ajax upload plugin or script to be used with wordpress?Best solution by WordPress
- How to return result from ajax call synchronously?Best solution by Stack Overflow
- How to execute ajax script on Jquery mobile?Best solution by Stack Overflow
- How do I create an HTML table, in jQuery, with JSON data?Best solution by Stack Overflow
- How to do pagination in ajax call?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.