如果我在我的电脑上以 http 的形式在 Chrome 中运行“应用程序”,那么alasql一切正常,但在 PhoneGap Build 构建应用程序后,alasql 功能不可用。
在应用程序中的“deviceready”之后调用所有 javascript(但在 Chrome 测试中的 $(document).ready() 中)。
index.html 链接到这些脚本(以及其他):
<script type="text/javascript" src="cordova.js"></script>
<script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="dist/alasql.min.js" type="text/javascript"></script>
...
<script type="text/javascript" src="js/index.js"></script>
ondeviceready
在 index.js 中,我有一个从(在 index.html 中)调用的函数:
alasql('CREATE localStorage DATABASE IF NOT EXISTS db'); //THIS IS WERE THE ERROR OCCURS
alasql('ATTACH localStorage DATABASE db');
alasql('USE db');
我已经重新安装了应用程序,但没有成功。仍然得到同样的错误。其他一切正常。有任何想法吗?