可以在我的网页中打开第 3 方网站的表单以及我网站上的一些材料吗
我正在尝试自动化向多个站点提交相同/相似数据的重复工作...在其中一些站点中,我想在我的 java web 应用程序中打开第 3 方 Web 表单,并显示一个按钮,要求用户“填写”表格。
单击该按钮后,一些 JavaScript 代码将使用适当的数据填充该网站上的各个字段...之后,最终用户可以将该表单提交到其操作。
我想知道的是,是否需要在iframe中打开第3方网站?是否可以直接在我的网络应用程序中打开第 3 方页面(通常是 php 页面)并在其旁边显示用于填写的按钮?一旦第 3 方网站给出响应(对表单提交),我的网络应用程序中应显示 2 个按钮 - “成功提交”和“失败提交”,以便提交者可以查看响应并相应标记提交成功或失败。
据我了解,需要使用 iframe 来显示第 3 方网站。还有其他方法可以做到这一点吗?
I am trying to automate a repetitive job of submitting same/similar data to multiple sites... In some of these sites, I want to open the 3rd party web form in my java web app, and show a button that asks the user to "fill in " the form.
Once that button is clicked, some javascript code will fill in the various fields on that site with appropriate data... After that the end user can submit that form to its action.
What I want to know is, is it necessary to open the 3rd party site in an iframe? Is it possible to open the 3rd party page (typically a php page) directly in my web app and show button alongside it for filling it in? And once 3rd party site gives its response (to the form submission) 2 buttons should be shown in my web app- "successful submission" and "failed submission" So that the person making the submission can take a look at the response and accordingly tag the submission as success or failure.
From what I have understood, there is a need to use iframes to display the 3rd party site. Is there some other way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
到目前为止,最简单的方法是使用 iframe。
另一种选择是让您的服务器端从第 3 方服务器获取页面,从页面中提取相关 HTML 并将其嵌入到您的页面中。然而,这并不容易,而且容易脆弱。例如,嵌入可能会破坏第 3 方页面中的 CSS 样式或 Javascript。
By far the simplest way to do this is using iframes.
Another alternative would be to have your server-side fetch the page from the 3rd party server, extract the relevant HTML from the page and embed it in your page. However, this is not easy, and is liable to be fragile. For example, the embedding may break the CSS styling or Javascript in the 3rd party page.