我正在寻找一种方式来使用相同的localStorage(或类似)两个http:// example .com和https:// example .com
根据这个,那会使用localStorage来是不可能的.虽然看起来似乎globalStorage没有.我正在为Chrome扩展做这个,所以使用cookie不是一个选项,不需要与其他浏览器兼容.
有任何想法吗?
javascript html5 google-chrome local-storage google-chrome-extension
我有一个JSON字符串,如下所示:
{
"resultType" : "history",
"currentTime" : "2011-10-22T15:46:00+00:00",
"columns" : ["date","orders","quantity","low","high","average"],
"rowsets" : [
{
"generatedAt" : "2011-10-22T15:42:00+00:00",
"rows" : [
["2011-12-03T00:00:00+00:00",40,40,1999,499999.99,35223.50],
["2011-12-02T00:00:00+00:00",83,252,9999,11550,11550]
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
每次我尝试解析它时,我都使用这样的代码:
var data = JSON.parse(json);
console.log(data);
Run Code Online (Sandbox Code Playgroud)
以下是打印到控制台的内容:
{
"resultType" : "history",
"currentTime" : "2011-10-22T15:46:00+00:00",
"columns" : ["date","orders","quantity","low","high","average"],
"rowsets" : [
{
"generatedAt" : "2011-10-22T15:42:00+00:00",
"rows" : [Object]
}
]
}
Run Code Online (Sandbox Code Playgroud)
我尝试了几件事,但我怎样才能获得现场数据rows?解析后,控制台只显示[Object].