次のサイトで質問があります。
Using IndexedDB - Web API Interfaces | MDN
javascript
1// In the following line, you should include the prefixes of implementations you want to test. 2window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; 3// DON'T use "var indexedDB = ..." if you're not in a function.
「if you're not in a function.」という部分がどういう意味かがわかりません。私はvar indexedDB
を使わない方がいい理由は、このスクリプトが名前空間を汚さないように、無名関数でラッピングしてライブラリ化されていても使い回せるようにと思いました。
上記のコメントで言っている、var indexedDB
を使わない理由とは何でしょうか?
ご回答、よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/08/26 02:28
2015/08/26 19:16
2015/08/27 02:14
2015/08/29 03:30