示例您可以尝试运行以下代码片段来检查分配的大小 -
var sum = 0;// loop for sizefor(var i in localstorage) { var amount = (localstorage[i].length * 2) / 1024 / 1024; sum += amount; document.write( i + " = " + amount.tofixed(2) + " mb");}document.write( "total = " + sum.tofixed(2) + " mb");
以上就是如何在html中找到localstorage的大小?的详细内容。
