I'm working on this TaskPane app for office, and I would like to get some data from a php function that resides on our domain.
We're using the same php function in other apps, where I can just call it with some parameters passed to it in the URL, and it returns a simple answer.
Example: https://www.ourdomain.com/phpfunction.php?message=HELLO
The problem is, that I cannot seem to call this function via AJAX, from the TaskPane app, while debugging.
I added our domain to the App Domains in the application manifest, but it didn't help
Here is my AJAX call
function httpGET(theUrl, callback) {
var dataToReturn;
$.ajax({
type: 'GET',
url: theUrl,
cache: false,
async: true,
data: "",
success: function(data, textStatus, result) {
callback(data)
},
error: function (result, textStatus, errorThrown) {
//ALLWAYS GOES HERE
}
});
};
I want to do it in pure javascript, so if it's possible, I don't want to use the custom .NET web service fix for this.
PS: I want to specify, that this exact same call is working perfectly from a mobile app or a browser based app. It's Office who's doing something here...