Skip to content Skip to sidebar Skip to footer

JS Confirm Box In Android Webview Not Working

Using this code to load url.Url is working fine in android & desktop browser. I have write Android code to show Confirm boxes in android. It's working fine in Nexus and Samsung

Solution 1:

"Uncaught TypeError: Cannot call method 'querySelector' of null" basically means that JS code in the webview tries to access the querySelector object of something that is interpreted as null.

Null is a primitive and doesn't have properties. So you probably have some programming error that relies on the existence of A for B to be populated but A doesn't seem to exist (querySelector is a method in document or elements).

What to do

Try to obtain a JS stack trace of the device errors an figure out why the the thing that SHOULD provide querySelector (document or an element) is null. Then solve that issue, and see if all shines well...

Possible causes

  • Document is not fully loaded when code is calling methods on it
  • Device specific code gone bad
  • Murphy's Law...

Post a Comment for "JS Confirm Box In Android Webview Not Working"