【发布时间】:2015-03-21 11:57:09
【问题描述】:
我有一个大小为 1Mb 的 JSON 文件。 我尝试用一个简单的例子来实现 typeahead.js:
<div class="container">
<p class="example-description">Prefetches data, stores it in localStorage, and searches it on the client: </p>
<input id="my-input" class="typeahead" type="text" placeholder="input a country name">
</div>
<script type="text/javascript">
// Waiting for the DOM ready...
$(function(){
// applied typeahead to the text input box
$('#my-input').typeahead({
name: 'products',
// data source
prefetch: '../php/products.json',
// max item numbers list in the dropdown
limit: 10
});
});
</script>
但是当我启动它时,Chrome 会说:
未捕获的 QuotaExceededError:无法在“存储”上执行“setItem”: 设置 '__products__itemHash' 的值超出了配额。
我能做什么?我正在使用 typeahead.min.js
【问题讨论】:
-
可能是浏览器中设置的首选项、每台计算机上的可用磁盘空间或其他一些环境差异。相关问题link
标签: javascript json google-chrome typeahead.js typeahead