使用 Scala/Lift 获取 iframe URL
全部。我正在开发一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为这是可能的,假设您正在尝试读取它所在的当前页面而不是默认发送的页面。
如果您尝试读取当前页面,那么服务器和客户端之间就需要进行交互,这意味着您必须使用一些 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.