关闭模式后刷新父页面 [英] Refresh parent page after closing modal

查看:179
本文介绍了关闭模式后刷新父页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户打开这个模式时,他们可以看到他们的购物车信息,并在模态上删除项目(其他jquery)。



但是,在用户关闭模态之后,如何刷新父页面?



我读了几篇文章,但没有找到任何有用的信息为我的情况。我知道我需要使用类似 window.location.reload(true); 这些代码中应该放在哪里?



($)$($)$($($)$($)$($) ',function(){

$('body')。loadmodal({

id:'cart',
title:'Shopping Cart',
url:'/ cartDisplay /',
width:'550px',
});


});
});

更新



< $($)$($($)$($($)$($)

$('body')。loadmodal({

id:'cart',
title:'Shopping Cart',
url:' / polls / cartDisplay /',
width:'550px',

});


});

$('#cart')。on('hidden',function(){
window.location.reload(true);
})

});


解决方案

尝试这个。


('hide',function(){
window.location.reload();

  $ }); 


When a user opens this modal, they can see their shopping cart information and delete items(other jquery) on the modal.

But how could I refresh the parent page after a user closes up the modal?

I read several posts but did not find any useful information for my situation. I know I need to use something like window.location.reload(true); Where should I put that in the code?

$(function(){

    $('#main').off('click.login').on('click.login',function(){

        $('body').loadmodal({

            id:'cart',
            title:'Shopping Cart',
            url:'/cartDisplay/',
            width: '550px',
        }); 


    });
});

Update

    $(function(){
    $('#main').off('click.login').on('click.login',function(){

        $('body').loadmodal({

            id:'cart',
            title:'Shopping Cart',
            url:'/polls/cartDisplay/',
            width: '550px',

        }); 


    });

    $('#cart').on('hidden', function () {
        window.location.reload(true);
    })

});

解决方案

Try this.

  $("#cart").on('hide', function () {
        window.location.reload();
    });

这篇关于关闭模式后刷新父页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆