Hi all,
I am calling external webservice in sharepoint office 365 using ajax call. I am using the following code to acces the external webservice.But i am getting the following error.
"Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json" . Any help would be helpful.Thanks in advance.
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(function () {
- debugger;
- try
- {
- $.ajax({
- url: "https://api.printful.com/countries",
- headers: {
- 'Access-Control-Allow-Credentials' : true,
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods':'GET',
- 'Access-Control-Allow-Headers':'application/json',
- },
- type: "GET",
- crossDomain: true,
- dataType: "jsonp",
- jsonp: 'jsonp-callback',
- async: false,
- success: function (data) {
- debugger;
- console.log("count= "+ data.d.results.length);
- if(data.d.results.length>0){
- alert("Results Count:"+data.d.results.length);
- }else{
- alert("no data");
- }
- },
- error: function (data) {
- console.log("Error");
- console.log(data);
- }
- });
- }
- catch(e)
- {
- console.log(e);
- }
- });
-
- </script>