添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Ce navigateur n’est plus pris en charge.

Effectuez une mise à niveau vers Microsoft Edge pour tirer parti des dernières fonctionnalités, des mises à jour de sécurité et du support technique.

Télécharger Microsoft Edge Plus d’informations sur Internet Explorer et Microsoft Edge
[Android.Runtime.Register("evaluateJavascript", "(Ljava/lang/String;Landroid/webkit/ValueCallback;)V", "GetEvaluateJavascript_Ljava_lang_String_Landroid_webkit_ValueCallback_Handler")]
public virtual void EvaluateJavascript (string script, Android.Webkit.IValueCallback? resultCallback);
[<Android.Runtime.Register("evaluateJavascript", "(Ljava/lang/String;Landroid/webkit/ValueCallback;)V", "GetEvaluateJavascript_Ljava_lang_String_Landroid_webkit_ValueCallback_Handler")>]
abstract member EvaluateJavascript : string * Android.Webkit.IValueCallback -> unit
override this.EvaluateJavascript : string * Android.Webkit.IValueCallback -> unit

Parameters

A callback to be invoked when the script execution completes with the result of the execution (if any). May be null if no notification of the result is required.

Remarks

Asynchronously evaluates JavaScript in the context of the currently displayed page. If non-null, resultCallback will be invoked with any result returned from that execution. This method must be called on the UI thread and the callback will be made on the UI thread.

Compatibility note. Applications targeting android.os.Build.VERSION_CODES#N or later, JavaScript state from an empty WebView is no longer persisted across navigations like #loadUrl(String) . For example, global variables and functions defined before calling #loadUrl(String) will not exist in the loaded page. Applications should use #addJavascriptInterface instead to persist JavaScript objects across navigations.

Java documentation for android.webkit.WebView.evaluateJavascript(java.lang.String, android.webkit.ValueCallback<java.lang.String>) .

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.