I am trying to put comments on Facebook wall using jquery.
But my ajax call not alowing external url .
can anyone explain how can we use external url with jq
Follow the below simple steps you will able to get the result
Step 1- Create one internal function getDetailFromExternal in your back end. step 2- In that function call the external url by using cUrl like below function
function getDetailFromExternal($p1,$p2) {
$url = "http://request url with parameters";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true
));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
exit;
}
Step 3- Call that internal function from your front end by using javascript/jquery Ajax.