【发布时间】:2016-12-08 02:17:03
【问题描述】:
我想在每次单击指向该文件的链接时增加索引文件的字段。
在点击链接的那一刻,这段代码(在 JavaScript 中)运行:
$http({
url: 'http://localhost:8983/solr/mybb/update/json?commit=true',
params: {
'wt': 'json',
'id': $scope.id,
'visits': { 'inc': 1 }
}
})
.success(function(data) {
console.log("UPDATE SUCCESSFUL!");
})
.error(function() {
console.log("UPDATE FAILED!");
});
当我运行它时,我得到了错误:
XMLHttpRequest cannot load
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
有人可以帮我纠正这个问题吗?
【问题讨论】:
标签: javascript apache http solr xmlhttprequest