Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 phonegap 中开发 android 应用程序我想从我的主要活动中调用 javascript。我使用了以下代码
appView.loadUrl("javascript:(function(){alert('sfksjf'); sessionStorage.setItem('notificationTap','Yes');})();");
这在 android 2.1 中工作得很好。
但在 android 2.2 中不调用 javascript 函数。
非常感谢任何帮助。
提前致谢
你应该使用:
appView.sendJavascript("(function(){alert('sfksjf'); sessionStorage.setItem('notificationTap','Yes');})();");
反而。