Skip to content Skip to sidebar Skip to footer

Android - Webview (kitkat And Below): Error In Java Script Function 'includes'

Trying to Call WebView , While Calling Local Web Page It will Gives Error Uncaught TypeError: Object ['Some Object'] has no method : 'includes', source: file:///storage/sdca

Solution 1:

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.

You need to make use of indexOf instead 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;

Post a Comment for "Android - Webview (kitkat And Below): Error In Java Script Function 'includes'"