How can I refresh a page with jQuery?

后端 未结 28 2521
刺人心
刺人心 2020-11-22 07:00

How can I refresh a page with jQuery?

28条回答
  •  臣服心动
    2020-11-22 07:16

    If you are using jQuery and want to refresh, then try adding your jQuery in a javascript function:

    I wanted to hide an iframe from a page when clicking oh an h3, for me it worked but I wasn't able to click the item that allowed me to view the iframe to begin with unless I refreshed the browser manually...not ideal.

    I tried the following:

    var hide = () => {
        $("#frame").hide();//jQuery
        location.reload(true);//javascript
    };
    

    Mixing plain Jane javascript with your jQuery should work.

    // code where hide (where location.reload was used)function was integrated, below    
        iFrameInsert = () => {
            var file = `Fe1FVoW0Nt4`;
            $("#frame").html(`

    Close Player

    `); $("h3").enter code hereclick(hide); } // View Player $("#id-to-be-clicked").click(iFrameInsert);

提交回复
热议问题