Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
I have the following script
JavaScript
function getJson(url) {
    var response;
    $.ajax({
        type: "POST",
        url: url,
        dataType: "jsonp",
        success: function (data) {
            response = data;
        }
    });
return response;
}


I am able to get the response successfully when I run this script in IE debugger but the same code gives "Operation Aborted" error in statusText when I am using it in a sharepoint-hosted app. Can anyone please suggest what I am doing wrong? For reference "http://rate-exchange.appspot.com/currency?from=USD&to=PKR" can be used as url.

Thanks,
Zafar
Posted
Updated 28-Apr-14 2:20am
v2
Comments
Bajirao_ 22-May-14 6:20am    
As we know SharePoint app create web and app url is different from host URL. so i suggest check js reference. add OnError function in ajax call, to get more proper error. check for permissions. if still you don't get expected result then i am also curious to know solution.

1 solution

Hi Zafar,

I see that there is n't any useful answers to your problem, and I was wondering if you in the meantime have come up an answer yourself.
I hope you have, because I am the facing the problem as you do/did.
Would you mind sharing the answer with me ?

Best regards,
Johnny O.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900