/// <summary> /// Evaluate a JavaScript string on current page. /// Although you can write complex javascript code and evaluate it at once, /// a suggest way is calling this method with a single js method name. /// The webview will try evaluate(execute) the javascript. /// When it finished, OnEvaluateJavaScript will be raised with the result. /// </summary> /// <param name="script">The JavaScript string to evaluate.</param> public void EvaluateJavaScript(string script) { Setup(); #if UNIWEBVIEW3_SUPPORTED UniWebViewInterface.EvaluateJavaScript(listener.Name, script, string.Empty); #elif UNIWEBVIEW2_SUPPORTED UniWebViewPlugin.EvaluatingJavaScript(listener.Name, script); #else WWebViewPlugin.EvaluatingJavaScript(listener.Name, script); #endif }
/// <summary> /// Send a piece of javascript to the web page and evaluate (execute) it. /// </summary> /// <param name="javaScript">A single javascript method call to be sent to and executed in web page</param> /// <description> /// Although you can write complex javascript code and evaluate it at once, a suggest way is calling this method with a single js method name. /// The webview will try evaluate (execute) the javascript. When it finished, OnEvalJavaScriptFinished will be raised with the result. /// You can add your js function to the html page by referring to the js file in your html page, or add it by using AddJavaScript(string javaScript) method. /// </description> public void EvaluatingJavaScript(string javaScript) { UniWebViewPlugin.EvaluatingJavaScript(gameObject.name, javaScript); }
public void EvaluatingJavaScript(string javaScript) { UniWebViewPlugin.EvaluatingJavaScript(((Object)((Component)this).get_gameObject()).get_name(), javaScript); }