if you want use only jQuery, you can create file.php with curl for you other path
in localhost:51789
function GetAllEmployees() {
jQuery.support.cors = true;
console.log("Entered to GetAllEmployees");
$.ajax({
url: 'http://localhost:51789/EmployeeAPI.php',
type: 'GET',
dataType: 'json',
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
}
EmployeeAPI.php
<?php
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'http://localhost:51848/api/EmployeeAPI');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
}
?>