-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