You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thats perfectly normal as the code executes within a limited scope, which is valid only during the ExecuteScript. In order to do that you need to assign the function to the global (window) scope.
First click Button5, then click Button6.
private void Button5_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
string js = "function aaaa(){ alert('a'); }";
webview.ExecuteScript(js);
//js = "aaaa();";
//webview.ExecuteScript(js);
//// It well Done
}
private void Button6_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
string js = "aaaa();";
webview.ExecuteScript(js);
//// Not Execute , Nonresponse
}
The text was updated successfully, but these errors were encountered: