使用 Scala/Lift 获取 iframe URL

发布于 2024-10-03 09:43:28 字数 168 浏览 2 评论 0原文

全部。我正在开发一个 Scala/Lift Web 应用程序,它使用 iframe 来显示来自同一域上托管的另一个 Web 应用程序的内容。有没有办法访问子框架当前显示页面的URL?针对一般问题找到的建议解决方案通常使用 Javascript,但如果可能的话,我希望使用 Scala 来完成此任务。

谢谢!

all. I am working on a Scala/Lift web application that uses an iframe to display content from another web application hosted on the same domain. Is there a way to access the URL of the child frame's currently-displayed page? The suggested solutions found for the general problem typically use Javascript, but I would to like accomplish this with Scala if possible.

Thanks!

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

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

发布评论

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

评论(1

只想待在家 2024-10-10 09:43:28

我不认为这是可能的,假设您正在尝试读取它所在的当前页面而不是默认发送的页面。

如果您尝试读取当前页面,那么服务器和客户端之间就需要进行交互,这意味着您必须使用一些 JavaScript。如果您试图找到它最初所在的页面,那么应该在程序中提前设置该页面,这样您就可以将该值存储在变量中并稍后访问它。

如果您澄清了您想要做什么,您可能会得到更完整的答案。

I don't believe this would be possible, presuming you are trying to read the current page that it is on rather than the page that is sent by default.

If you are trying to read the current page it is on then that would necessitate interaction between the server and the client, meaning you would have to use some javascript. If you are trying to find the page it was on originally then that should have been set earlier in your program so you will be able to just store that value in a variable and access it later.

If you clarified which you were trying to do you might get a more complete answer.

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