0

I have tried the following with no success, any help will be appreciated.

UIPasteboard *pb = [UIPasteboard generalPasteboard];

[pb setString:passwordName];

NSString *jScriptString;

jScriptString = [NSString stringWithFormat:@"var output = {document.getElementById;" " ;output.innerHTML = document.activeElement.value = '%@'}",  passwordName];


[self.viewWebSite stringByEvaluatingJavaScriptFromString:jScriptString];
4

1 回答 1

0

只是在这里猜测,但是当您 uiwebview 加载页面时,您可以添加一个 .js 文件,该文件位于您的 ios 应用程序的本地,为 dom 中的每个输入字段添加一个 onfocus 方法。然后你可以让 onfocus 事件通过 window.location 属性将元素 id 传递给 iOS,webView:shouldStartLoadWithRequest:navigationType: 可以监控。

于 2013-06-18T18:04:15.667 回答