How can I run Javascript in flutter_webview_plugin? I tried with this:
onPressed: () {
flutterWebviewPlugin.evalJavascript('<script language="JavaScript" type="text/javascript">alert("Hello World")</script>');
},
But nothing happens.
I thought with flutterWebviewPlugin.evalJavascript
it's possible to run Javascript in a Webview.
Did I do something wrong?
flutterWebviewPlugin.evalJavascript('<script language="JavaScript" type="text/javascript">alert("Hello World")</script>')
expects JavaScript, not HTML
<script language="JavaScript" type="text/javascript">alert("Hello World")</script>
is HTML.
Try
flutterWebviewPlugin.evalJavascript('alert("Hello World")')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With