I am trying to produce a site that pulls api data from the 3 different domain names. I've looked everywhere which is getting a little frustrating. From my research, it appears obvious that you simply can't pull multiple as well as certain singular api data via javascript/ajax because of domain issues. However haven't found every other method in which appears to operate.

I figured that it might be worth an attempt to drag from each api from it's own page, but that does not appear to operate either. When tugging data from multiple domain names, what's the best path to go?

To begin with, find out if the mix-domain scripting approach is useful for you. Next, jQuery's $.ajax supports some mix-domain demands.

Otherwise, another options would be to have your server perform the heavy-lifting via cURL. Most servers must have cURL available. For instance (replicated mostly verbatim from here), you might have a webpage in your server that simply performs this:


$ch = curl_init("http://world wide web.example.com/")

curl_setopt($ch, CURLOPT_HEADER, )

curl_setopt($ch, CURLOPT_Publish, 1)

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1)

$output = curl_professional($ch)


echo $output


You are able to format the output any way you like -- e.g. for JSON PHP includes a json_scribe assistant function -- after which use something similar to jQuery's $.ajax to retrieve the information out of your own server. Clearly, this last measure might have performance implications for the server, so use moderately.