-2
我jQuery的功能看起来以下,商店返回值
var d= rdldb.restaurantbooking.where('date').equals("2015-09-30").toArray(jstr);
//jstr is a function
function jstr(v){ return JSON.stringify(v); }
//console.log(JSON.stringify) shows my desired output
//and the same output need to be shown when i display variable d.
/* output of jstr() function is
[{"booking_id":-2,"restbooking_id":"RDOFFL-2",,"bstate":"on"}
,{"booking_id":"18487","restbooking_id":"RDOFFL-3","bstate":"on"},
{"booking_id":"18488","restbooking_id":"Id9","bstate":"on"},
{"booking_id":"18489","restbooking_id":"d","bstate":"on"}]
*/
console.log(d); //Output is empty .
jstr()
功能没有返回值变量d。
在第一个函数中获得所需输出的解决方案是什么?
仅供参考这里没有jQuery代码。其次,where(),equals()和toArray()是什么输出? –
某些浏览器不会在控制台中显示对象,除非调试器也处于打开状态,请尝试在Firefox中使用F12,而不是仅使用浏览器控制台 – Icepickle
@RoryMcCrossan。这是jQuery中实现的indexedDB函数 – Arockiaraj