从 iframe (jquery) 捕获窗口打开事件
我的页面上有一个 iframe(不在同一域上)。其中,有内部链接和外部链接(目标为空白)。对于外部链接,我将应用 JavaScript 函数来转换目标 URL。
我想捕获窗口打开事件(或其他事件?),它允许我获得目标 URL。 我尝试过使用 JQquery :单击“a”对象上的事件,但它不起作用(因为 iframe 不在同一域上)并且有很多其他事件......但没有任何效果!
你有什么想法吗?
有关信息,我的 javascript 函数使用 Xiti 参数重写 URL 并执行 window.open(newURL, '_blank')
I have an iframe (not on the same domain) on my page. In this, there are intern-links and extern-links (with target blank). For the extern-links, I would apply a javascript function to transform the destination URL.
I would like to catch the window open event (or other event ?) which allows me to have the destination URL.
I have tried with JQquery : click event on "a" object but it doesn't work (because iframe is not on same domain) and with a lot of others events... but nothing works !
Have you some ideas ?
For information, my javascript function rewrites the URL with Xiti parameters and does a window.open(newURL, '_blank')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于安全限制,您想要做的事情似乎被阻止了。您是否考虑过将事件处理程序添加到 iframe 内的页面中?
It seems like what you're trying to do is being blocked due to security restrictions. Have you considered adding your event handler into the page that's inside the iframe?