Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

WebView.EvaluateJavaScriptAsync always null

$
0
0

I'm trying to use WebView.EvaluateJavaScriptAsync.

I'm just using this page to test with

If you try it in Chrome and in the debug console type
myFunction(123, 456)

It says "56088".

But in Xamarin.Forms if I do:

string result = await webView.EvaluateJavaScriptAsync($"myFunction(123, 456)");

result is always null

I can do other things, and they work fine:

string result2 = await webView.EvaluateJavaScriptAsync("27 + 92");
string result3 = await webView.EvaluateJavaScriptAsync("alert('hey')");
string documentBodyInnerHTML = await webView.EvaluateJavaScriptAsync("document.body.innerHTML");

Anyone know how to get this working?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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