如何捕获弹出窗口上显示的数据

发布于 2025-01-07 01:48:13 字数 278 浏览 2 评论 0原文

我有一个网络应用程序,用户在网页上选择一些选项并单击“提交”按钮。单击提交按钮后,应用程序会查询数据库并在弹出窗口中显示结果。现在,我有一个奇怪的要求,即捕获弹出窗口中显示的数据并将其保存在另一个数据库中。我的问题是,如何获取弹出窗口中显示的数据。我对此类东西非常陌生,并且不知道如何继续。

我将通过示例来解释上述场景。

比方说,用户在网页中输入他的姓名并单击“提交”。提交时,会查询数据库,并在弹出窗口中显示该特定人的年龄。现在,我必须捕获年龄的值并将其保存到另一个数据库。

I have a web application where the user selects some options on the web page and clicks 'submit' button. On clicking the submit button, the app queries a DB and displays the results in a pop-up window. Now, I have a strange requirement to capture the data that is displayed in the pop up window and save it in another DB. My question here is, how to get hold of the data that is displayed in the pop-up window. I am very new to this kind of stuff and im clueless about how to proceed.

Ill explain the above scenario with the help of an example.

Lets say, the user enters his name in the webpage and clicks submit. On submit, the DB is queried and the age of that particular person is displayed in the pop up. Now, I have to capture the value of age and save it another DB.

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

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

发布评论

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

评论(2

白色秋天 2025-01-14 01:48:13

当数据库返回第一个查询的值(在您的例子中为年龄)时,首先将值存储在某个变量中,而不是显示数据。现在,触发另一个查询来存储获取的数据(年龄)。第二个查询完成后,即年龄保存在数据库中,您可以像现在一样显示年龄。

希望这有帮助!

When the DB returns the value for the first query (age in your case), instead of displaying the data, first store the value in some variable. Now, fire another query for storing the fetched data (age). After the second query is completed i.e. the age is saved in the DB, you can display the age as you are doing it right now.

Hope this helps !!!

风柔一江水 2025-01-14 01:48:13

javascript 中用于创建弹出窗口的 open 方法返回用于访问该弹出窗口的 DOM 的对象。您可以使用该对象来访问弹出窗口的内容。

请参阅:http://www.w3schools.com/jsref/met_win_open.asp

The open method in javascript for creating a pop-up window returns the object for accessing the DOM of that popup window. You can use this object to access to contents of the pop-up window.

See: http://www.w3schools.com/jsref/met_win_open.asp

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