Dem*_*usa -1 html javascript backend api-key webdatarocks
我想将 API 密钥附加到我的 URL 以访问数据库,问题是将它附加到文件名
var pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
report: {
dataSource: {
filename: "https://testing-195b.restdb.io/rest/customerdata"
}
}
});
Run Code Online (Sandbox Code Playgroud)
此代码适用于控制台
var settings = {
"async": true,
"crossDomain": true,
"url": "https://testing-195b.restdb.io/rest/customerdata",
"method": "GET",
"headers": {
"content-type": "application/json",
"x-apikey": "60c8b39ee2c96c46a2463581",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Run Code Online (Sandbox Code Playgroud)
小智 7
如果需要传递请求头,最好通过与 WebDataRocks 分开发出请求来获取数据。这样它就可以包含所有需要的信息。之后,可以通过以下方式将数据从网页馈送到 WebDataRocks:
var pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
report: {
dataSource: {
data: yourData // your variable containing the data
}
}
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
74 次 |
最近记录: |