我正在尝试成功获得回调,但我一直遇到错误,指出“XMLHttpRequest无法加载http://api.bitcoincharts.com/v1/markets.json。请求的资源上没有'Access-Control-Allow-Origin'标头。因此,'null'不允许访问。“这是我的javascript。
$(document).ready(function(){
$(".btn").on("click", function(){
var userDate = $("#userDate").val();
var bitcoinApiUrl = "http://api.bitcoincharts.com/v1/markets.json";
var bitcoinApiParams = {
method:"currency"
}
// bitcoinApiUrl += "¤cy" + userDate;
$.ajax({
type: "GET",
AccessControlAllowCredentials: true,
// AccessControlAllowOrigin:
url: bitcoinApiUrl,
success: function(response) {
}
});
});
});