跨域片段标识符破解不再起作用了吗?
我看到这个被引用了很多: http://ajaxify.com/run/crossframe/
我注意到现在它不再适用于 IFRAME(子级)来更改父级哈希。
我花了几个小时尝试各种事情,想知道为什么这不再起作用——然后我终于意识到我最初基于它的示例也失败了。
有人可以证实吗?
-
-
我需要使用跨域 iframe 来处理我们的购物车不支持的订单上传表单,并且我需要该表单将订单 ID 返回给父级,以便我可以关联两个服务器之间的数据。
任何建议或方向将不胜感激。
我并不是在寻找捷径或找人来完成我的工作。我已经读了一整天......我只需要在正确的方向上推动。
谢谢!
I see this referenced a lot: http://ajaxify.com/run/crossframe/
And I noticed now it's no longer working for the IFRAME (child) to change the parents hash.
I've been spending a few hours trying various things wondering why this isn't working anymore -- then I finally realized that the example I originally based it on was down too.
Can anybody confirm?
-
-
I need to use a cross domain iframe to take care of an order upload form that our shopping cart doesn't support, and I need the form to return an order ID to the parent, so that I can associate the data between the two servers.
Any recommendations or directions to head in would be appreciated.
I'm not looking for a shortcut or somebody to do my work. I've been reading all day... I just need a nudge in the right direction.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它部分是特定于浏览器的。例如,某些浏览器不允许嵌套子框架(iframe 内的 iframe)更改其父级的片段。请参阅此博客条目 。但基本功能在最新的浏览器中仍然有效。 这个演示,它有一个 iframe 更改其父级,反之亦然(单个level) 在 Firefox 3.5.9 和 Chrome 5.0.375.99 中工作正常。
您提供的演示在该版本的 Firefox 中也可以两种方式运行。它不允许子级在 Chrome 中更改父级。主要区别似乎是工作的使用
parent.location
,而损坏的使用parent.window.location.hash
。对于最新浏览器来说,最佳解决方案是 postMessage。如果需要,您还可以使用服务器代理。
It is partly browser-specific. For instance, some browsers don't allow a nested child frame (iframe within an iframe) to change its parent's fragment. See this blog entry. But the basic functionality still works in recent browsers. This demo, which has an iframe change its parent, and vice versa (single level) works fine in Firefox 3.5.9 and Chrome 5.0.375.99.
The demo you gave also works both ways in that version of Firefox. It doesn't allow the child to change the parent in Chrome. The main difference seems to be that the working one uses
parent.location
, while the broken one usesparent.window.location.hash
.The best solution for recent browsers is postMessage. If necessary, you can also use a server proxy.