0
我有幾個基本的本地json文件。我想用keen.io來可視化json數據。但不知何故,我無法將我的活動發送給敏銳。控制檯中沒有錯誤。如何在敏銳的js中讀取簡單的json文件
var client = new Keen({
projectId: "key",
writeKey: "key"
});
var data = $.getJSON("data/web_stories.json", function(data) {
var storyData = data
Keen.ready(function(){
var multipleEvents = {
"stories": data
};
// Send multiple events to several collections
client.addEvents(multipleEvents, function(err, res){
if (err) {
console.log('there is an error!')
}
else {
console.log('data sent')
}
的數據看起來像這樣
[
{ link: "www.link.com",
heading: 'here is the heading',
image: "www.image.com" },
{ link: "www.link.com",
heading: 'here is the heading',
image: "www.image.com" }
]
它不解決這個問題,它給我的錯誤,從熱衷於它的自我:是ADDEVENTS不是一個函數 – Imo
意思有什麼錯誤在你的客戶創造。你是否傳遞了正確的projectID和writekey? – gbalduzzi
是的鍵很好,但不知何故該功能沒有運行。例如,當我console.log(storyData)控制檯中沒有任何東西 – Imo