是否可以使用外部附件框架在 iPhone UIWebView 中填充 HTML 表单字段数据?

发布于 2024-08-28 01:38:52 字数 299 浏览 3 评论 0原文

我有一个 iPhone 应用程序,我想将远程服务的 HTML 表单加载到 UIWebView 中,然后在使用“外部附件框架”从外部附件获取数据时填充该表单。现在数据是手工输入的。建议的流程是:

  1. 获取包含表单的 HTML 页面并将其放入 UIWebView
  2. 当数据可从外部附件获取时,填充表单字段
  3. 提交表单

是否可以通过从外部附件“注入”数据来完成此操作当从外部附件检索到所有必需的数据时,外部附件进入 UIWebView 吗?我似乎找不到任何关于如何使用外部附件框架来实现这一目标的好例子。

I have an iPhone app where I'd like to load a remotely served HTML form into a UIWebView and then populate that form as data becomes available from an external accessory using the "External Accessory Framework." Right now the data is entered by hand. The proposed flow is:

  1. Fetch an HTML page containing a form and put it into a UIWebView
  2. When data becomes available from the external accessory, populate the form field(s)
  3. Submit the form

Is it possible to do this by "injecting" data from the external accessory into the UIWebView when all required data has been retrieved from the external accessory? I cannot seem to find any good examples on how to use the external accessory framework to achieve this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗地喜欢 2024-09-04 01:38:52

虽然我自己没有更改表单字段,但我认为您可以使用 UIWebView 的 stringByEvaluatingJavaScriptFromString: 方法来运行任意 JavaScript 来操作 DOM 并设置这些表单字段根据需要。

While I haven't mucked with changing form fields myself, I think you can use UIWebView's stringByEvaluatingJavaScriptFromString: method to run arbitrary JavaScript to manipulate the DOM and set those form fields as desired.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文