I'm trying to create a sharepoint app that gets and use json data generated on another web site / web application through an ajax request. Let's say the JSON data I want to get from the other website is a list of some laptop brands.
The sharepoint app / environment is on another server than the website with the laptop brands and the laptop website isn't related to sharepoint in any way. Assume the following:
var laptopUrl = "https://examplewebsite.com/laptopbrands"; // returns a json list with laptop brands
var sharepointWebsite = 'https://totallydifferentwebsite.com/sharepoint';
When navigation to the laptopUrl in the browser it outputs the json data, but when using the code in the sharepoint app no data is returned. I've tried using the following code (and several other jQuery AJAX requests):
$.getJSON( laptopUrl, function( data ) {
console.log(data); // Empty
});
I've been trying several ways to get the JSON data in the sharepoint app but with no success... I saw an example of a Yahoo weather app that pretty much did what I wanted but when I changed the URL to my own JSON output, the result was empty...
Am I doing something wrong or is what I'm trying to achieve simply not possible?
Thanks in advance,
ilians