简体   繁体   English

可以在我的网页中打开第三方网站的表格以及我网站上的一些资料

[英]can a 3rd party site's form be opened in my webpage, along with some material from my site

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. 我正在尝试自动化向多个站点提交相同/相似数据的重复工作...在这些站点中,我想在我的Java Web应用程序中打开3rd party Web表单,并显示一个要求用户执行以下操作的按钮“填写表格。

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. 单击该按钮后,一些javascript代码将使用适当的数据填充该网站上的各个字段...之后,最终用户可以将该表单提交给其操作。

What I want to know is, is it necessary to open the 3rd party site in an iframe? 我想知道的是,是否有必要在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? 是否可以直接在我的Web应用程序中打开第三方页面(通常是php页面),并在旁边显示按钮以进行填写? 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. 一旦第3方网站做出了对表单提交的回复,则应在我的Web应用程序中显示2个按钮-“成功提交”和“提交失败”,以便提交者可以查看回复并相应地标记提交是成功还是失败。

From what I have understood, there is a need to use iframes to display the 3rd party site. 据我了解,有必要使用iframe来显示第三方网站。 Is there some other way of doing this? 还有其他方法吗?

By far the simplest way to do this is using iframes. 到目前为止,最简单的方法是使用iframe。

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. 另一种选择是让服务器端从第3方服务器获取页面,从页面中提取相关的HTML并将其嵌入到页面中。 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. 例如,嵌入可能会破坏第三方页面中的CSS样式或Javascript。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM