I'm trying to fetch some data from this json javascript code and print them to PHP using CURL
<html>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<body>
<script type="text/javascript">
jQuery.ajax(
{
type:"POST",
contentType:"application/json;charset=utf-8",
url:"https://www.bancopromerica.com.gt/wsservicebus/wsonlineservicebus.asmx/getTipoCambio",
data:"{}",
dataType:"json",
async: false,
success: function(msg) {
a("#compInter",msg.d.compraInternet); //Compra Internacional
a("#ventInter",msg.d.ventaInternet); //Venta Internacional
a("#compAgencia",msg.d.compraAgencia); //Compra Agencia
a("#ventAgencia",msg.d.ventaAgencia); //Venta Agencia
},
error: function(textStatus, errorThrown, errorDetail){
alert(errorDetail);
}
});
function a(a,b)
{
jQuery(a).append(b);
}
</script>
</body>
</html>
I receive this error:
[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://code.jquery.com/jquery-1.12.0.min.js :: .send :: line 4" data: no]
Do you have any idea how to do this right in PHP ?