How to redirect page inside iframe to another one but we must stay in iframe

后端 未结 2 584
半阙折子戏
半阙折子戏 2021-02-04 11:25

Could anyone help me? Is it possible to code this? Redirect page inside iframe to another one but we must stay in iframe . Without influence to parent site. I tried many scripts

2条回答
  •  情书的邮戳
    2021-02-04 12:07

    $(function() {
        if ('app' !== $('body').attr('id')){
            window.setTimeout(function(){
                window.top.location.href = 'your redirect url'; 
            }, 5000);
        }
    });
    

    in IFRAME use

    sandbox="allow-top-navigation allow-scripts allow-forms"
    

提交回复
热议问题