更新时间:2023-12-04 13:36:40
发生这种情况是因为您使用的是 includes
方法在字符串我n您的js文件受最新JavaScript版本 ECMAScript 6 支持,而android kitkat webview不支持此版本。
This is happening because you are using includes
method on string in your js file, which is supported in latest JavaScript Version ECMAScript 6 and android kitkat webview doesn't support this version.
使用 indexOf
代替 includes
var str = "Hello world, welcome to the universe.";
var n = str.includes("world");
# Replace above line of code and use indexOf.
var n = str.indexOf("world") > -1;