I use php with file_get_contents and works perfectly for get some results from url, but if use load for show the page and results with jQuery, doesn't show anything.
I have one page that give me some results I need, I call page from url, and show the result.
When call from other domain, etc, show me the content and these results, for example :
$results=file_get_contents("http://loadwebdata.com/results.php");
results.php call to these results using curl.
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3000);
curl_setopt($ch, CURLOPT_TIMEOUT, 10000);
$result = curl_exec($ch);
curl_close($ch);
return $result;
And all works fine, but the only problem is when I want show these results for example using load from jQuery:
jQuery(document).ready(function() {
jQuery("#loader").show("10").load("http://loadwebdata.com/results.php");
});
<div id="loader"></div>
In this case, with jQuery doesn't show anything, by this the question, because the result haven't any format, is simple text and I understand from jQuery must show without any problem, but no, it won't show.