对于我的 Android Webview 应用程序,我必须执行 XMLHttpRequests 以包含通过 jquery .load 函数存储在 Assets 中的 html 文件。我发现我可以通过在我的 android 项目的 stackoverflow 上添加以下代码来完成这项工作:
web .getSettings().setAllowUniversalAccessFromFileURLs(true);
Eclipse 告诉我这至少需要 Api Level 16。这是否意味着只能使用 Api Level 16 和更高级别执行 XMLHttpRequests,还是意味着在较低版本上默认支持它?
亲切的问候, 托比
最佳答案
我自己回答的:)
在 developer.android.com 上找到这个
The default value is true for API level ICE_CREAM_SANDWICH_MR1 and below, and false for API level JELLY_BEAN and above.
关于javascript - Android - 允许 XMLHttpRequest 到 API 级别 < 16 上的本地文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16702453/