“Refresh Page JS” Kode Jawaban

Refresh Window JS

window.location.reload();
Worried Wolf

cara memuat ulang halaman yang sama menggunakan javascript

BY LOVE
window.location.reload();
Light Leopard

Refresh Page JS

//with no cache
document.location.reload(true);
//else
document.location.reload();

/**
 * Si le paramètre est nul, recharge la page, sinon recharge la page avec le paramètre.
 * If the parameter is null, reload the page, else, reload the page with the parameter
 * @param [param=null] - Le paramètre que vous souhaitez ajouter à l'URL.
 */
function reloadPage(param = null){

    if ( param != null ){
        window.location.href = window.location.href.replace( /[\?#].*|$/, `${param}` );
    }

    else
    { 
        if ( window.location.href.split('?').length > 1 ){
            window.location.href = window.location.href.split('?')[0];
        }

        else 
            window.location.reload();
    }

    //param == null ? window.location.reload(): window.location.href = window.location.href.replace( /[\?#].*|$/, `${param}` );
}
Joyous Jaguar

Refresh Page JavaScript

location.reload();
// OR
window.location.reload();
Anxious Alligator

Refresh Page JS

window.location.reload(true);
Enthusiastic Elephant

Refresh Page JS

<!DOCTYPE html>
<html>
<body>
    <p id="demo">Click the button Try it </p>
    <button onclick="myFunction()">Try it</button>

    <button onClick="window.location.reload();">Refresh Page</button>

    <script>
        function myFunction() {
            document.getElementById("demo").innerHTML = "Click the button refrech PAGE";
        }
    </script>
</body>
</html>
lerboh

Jawaban yang mirip dengan “Refresh Page JS”

Pertanyaan yang mirip dengan “Refresh Page JS”

Lebih banyak jawaban terkait untuk “Refresh Page JS” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya