Cir*_*gas 3 javascript redirect
我有一个带有iframe的页面,在这个iframe的内容中,所有窗口都有重定向,我该怎么做?
尝试:
window.location.href = 'logged.html';
如果页面是在框架中打开还是向上打开,我可以得到?
if(isiframe) window.top.location.href
Run Code Online (Sandbox Code Playgroud)
---解决方案---
if($("#cboxOverlay", top.document).length > 0)
if($("#cboxOverlay", top.document).css("display") != 'none')
window.top.location.href = '{{ path('portada') }}';
Run Code Online (Sandbox Code Playgroud)
如果它们位于您可能使用的同一域中
window.top.location.href = 'logged.html';
Run Code Online (Sandbox Code Playgroud)
否则stackoverflow中有很多类似的线程:
| 归档时间: |
|
| 查看次数: |
9510 次 |
| 最近记录: |