Windows Phone 8.1 javascript应用程序上未定义的indexedDB [英] undefined indexedDB on Windows Phone 8.1 javascript app
问题描述
我在(HTML / javascript)Windows应用商店应用上有以下代码
I have the following code on a (HTML/javascript) Windows Store app
var reqOpen = window.indexedDB.open(that.dbName, that.dbVersion);
当我想在(HTML / javascript)Windows Phone上使用该确切代码时8.1 app我在 window.indexedDB
上获得 undefined
。
The thing is, when I wanted to use that exact code on a (HTML/javascript) Windows Phone 8.1 app I get undefined
on window.indexedDB
.
我似乎无法在WinPhone上找到任何与indexedDB相关的示例或任何内容。我发现提到Windows Store和Windows Phone应用程序的唯一文章是这个,但不清楚平台是否存在差异
I can't seem to find any samples or anything related to indexedDB on WinPhone. The only article that I found that mentions both Windows Store and Windows Phone apps is this one, but it is not clear if there's a difference for either 'platform'
我错过了什么?
推荐答案
在Windows Phone 8.1 HTML商店应用程序中无法使用IndexedDB。
IndexedDB is not available on Windows Phone 8.1 HTML store apps.
我写了 SQLite for Windows Apps博客文章提到这一点并描述了如何解决它:在WinRT中包装SQLite并使用它。
I wrote a SQLite for Windows Apps blog post which mentions this and describes how you might work around it: wrap up SQLite in WinRT and use that instead.
博客文章主要是创建自己的,但它也链接到一些现有的项目,这样做和可能有可接受的许可证,包括 SQLite-WinRT 。
The blog post is mostly about creating your own but it also links to some existing projects that do this and that might have acceptable licenses for you, including SQLite-WinRT.
SQLite不一定你唯一的选择,但它是我所知道的唯一一个流行的,已编写VS扩展,并积极支持在Windows商店应用程序中运行。
SQLite isn't necessarily your only option, but it is the only one I know of that is popular, has written VS extensions, and is actively supporting running in Windows store apps.
这篇关于Windows Phone 8.1 javascript应用程序上未定义的indexedDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!