Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (evaljs)
Viewing all articles
Browse latest Browse all 83

WebView evalJS "Undefined is not a function".

$
0
0

I am using the webView API to load a remote site, and perform javascript operations on the site. While this works for most functions (getElementById, for instance), it doesn't seem to work for document.querySelectorAll(). When I try to use this method, I get the following error.

[WARN] Exception in event callback. {
    line = 18;
    message = "'undefined' is not a function (evaluating 'webView.evalJs(\"document.querySelectorAll('#search .g h3')[0].innerText;\")')";
    name = TypeError;
    sourceId = 190892576;
}
This only seems to happen after I fill out a form dynamically with javascript and submit the Google search. Running this command in the Safari Develop Console seems to work fine. What am I missing?

Viewing all articles
Browse latest Browse all 83

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>