【问题标题】:how to handle html button in webView (cocoa)如何处理 webView 中的 html 按钮(可可)
【发布时间】:2012-05-01 09:40:06
【问题描述】:

如何处理在 WebView 中按下 HTML 按钮,该按钮如下所示:

<input type="submit" name="mybutton" id="mybuttonid" value="test" />

WebView 是 Mac 桌面应用程序的一部分。

【问题讨论】:

  • 句柄是什么意思?你想点击按钮,还是获取点击事件?

标签: html macos cocoa webview


【解决方案1】:

我不太清楚您所说的处理按钮是什么意思,但您的解决方案可能会涉及使用“stringByEvaluatingJavaScriptFromString”。

例如:

[yourWebView stringByEvaluatingJavaScriptFromString:@"document.getElementById('mybuttonid')"];

希望这会有所帮助:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-31
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多